If no candidate gets a majority of electoral votes in the United States, states each get one vote for who becomes president. What happens if 25 states vote for the Democrat and 25 vote for the Republican? Does the VP break the tie? Is there a system for if, say, 23 votes go to the Democrat, 23 the Republican, and four go to a third-party candidate, no one getting a plurality or a majority?
If a Presidential election is sent to the House of Representatives, a candidate will require a majority of state delegations (26 out of 50) to be elected. If the House fails to make such a choice by January 20, then the Vice President Elect serves as Acting President until the House of Representatives take a choice (12th Amendment). If neither the Electoral College nor the Senate has been able to choose a Vice President Elect, then the Speaker of the House will serve as Acting President (3 USC §19).
The scenario that you highlighted happened in the 1800 Presidential Election. In the first ballot, with 9 states needed for a majority in the House, Jefferson carried 8, Burr carried 6, and 2 were divided and cast blank votes. Throughout the following couple of months, this vote was repeated 36 times. On ballot 36, MD and VT switched from blank votes to Jefferson, finally getting him above the line.
(Note: This was during the time when the runner-up would become Vice President, but it is nonetheless a reasonable precedent for your scenario.)
To summarize: The House would have to vote again and again until it made a majority decision, and if it could not do so by January 20th, then the normal rules of presidential succession apply until the House does make a majority decision.