The regular process
Candidates register through any of primaries, party nomination, or independent registration. In the general election, electors are selected state-by-state. In December, they vote in accordance with the election laws of their state. If someone gets a majority of the electors (270 of 538 currently), that person is president. If not, there is a secondary process.
In case of failure to get a majority, the House can select the next president from the top three candidates in the electoral college. In case of a tie for third, this could be more than three candidates. If less than three candidates receive electoral college votes, only those that did are qualified. Note that this is a president, not an acting president.
The voting rules are somewhat odd and arcane. Each state delegation has a single vote and a majority (26 of 50) is needed for a decision. So the party running the House does not necessarily win. For example, there was speculation in 2016 that a narrow Democratic victory in the House might not flip enough states to eliminate Republican control of the delegations.
If neither the electoral college nor the House of Representatives selects a president by inauguration, an acting president takes office until the House of Representatives makes a selection. Note that the electoral college only gets one vote, but the House of Representatives can take as many as necessary.
A special election can be called by act of Congress when there is no President-Elect and no Vice-President-Elect available to assume office on Inauguration Day. The special election results in an Acting President, who then assumes the duties of President until such time as a President can be sworn in, presumably from the line of succession to the Presidency.
If there is no president-elect qualified on election day, it starts rolling down the presidential line of succession. First to the Vice-president-elect and then to the Speaker of the House and then to the President pro tempore of the Senate. That person would be the acting president.
Why should the Acting President hold office only temporarily, and not until the end of the term just vacated?
Because the acting president would not have been elected as president in this situation. Presumably the regular process will eventually result in a president and that person will want the office.
Note that the presidential term is longer than the House term. So the new House could finally agree on a president two years later. That person would supplant the acting president.
The basic point is that the House not selecting a president in that circumstance is regarded as a temporary condition. Contrast that with a permanent condition like death.
In any situation where Congress elects the President, replacing an election by the populace at large, is this not an infringement of the principle of separation of powers? Should it not be the case that any office holder who assumes the Presidency in the line of succession, without election to the office of President, should assume presidential duties only as Acting President, until such time as a special election can be held to duly elect a President and Vice-President?
Congress can only select a president from the candidates presented by the electoral college. Perhaps that is a violation of separation of powers, but the constitutional writers preferred this minor violation to the more complicated potential problems of repeated failed elections. If the nation failed to select a president the first time, why would a second election be more effective?
Another issue is that elections are not quick. The typical presidential election lasts more than a year. So if the 2016 election had failed to produce a result (technically still possible but unlikely), the next election wouldn't complete until early 2018.