What are the requirements to replace the speaker of the House?
A new speaker is selected whenever the conditions to pick a new speaker arise:
The House elects its speaker at the beginning of a new Congress (i.e. biennially, after a general election) or when a speaker dies, resigns or is removed from the position intra-term.
To remove a speaker requires the House to vote to do so:
A Speaker may be removed at the will of the House, and a Speaker pro tempore appointed.
A resolution declaring the Office of Speaker vacant presents a question of constitutional privilege, though the House has never removed a Speaker. It has on several occasions removed or suspended other officers, such as Clerk and Doorkeeper. A resolution for the removal of an officer is presented as a matter of privilege.
The Speaker is elected by the entire House. Whoever has the majority vote gets the job. Theoretically, it’s a non-partisan vote, where anyone could convince enough of their colleagues (regardless of party) to support them as to win. In practice, the Speaker is whoever the majority of the majority party want it to be.
To replace the Speaker requires another majority vote. Former Speaker John Boehner resigned in 2015, in part because a large part of the Republicans in the House were unhappy with his leadership, triggering a vote.