US Constitution, 20th amendment, section 3
“Section 3. If, at the time fixed for the beginning of the term of the President, the President elect shall have died, the Vice President elect shall become President. If a President shall not have been chosen before the time fixed for the beginning of his term, or if the President elect shall have failed to qualify, then the Vice President elect shall act as President until a President shall have qualified; and the Congress may by law provide for the case wherein neither a President elect nor a Vice President elect shall have qualified, declaring who shall then act as President, or the manner in which one who is to act shall be selected, and such person shall act accordingly until a President or Vice President shall have qualified.
Section 4. The Congress may by law provide for the case of the death of any of the persons from whom the House of Representatives may choose a President whenever the right of choice shall have devolved upon them, and for the case of the death of any of the persons from whom the Senate may choose a Vice President whenever the right of choice shall have devolved upon them.”
In plainspeak, this means that if the President-elect fails to qualify or dies before inauguration, the Vice President-elect will act as President until such a time as a President has qualified.
The Constitution also directs Congress to determine by law a successive line of service to be called upon in the unlikely occurrence that both the President-elect and Vice President-elect fail to qualify (or die) by the beginning of the presidential term. Accordingly, federal law (3 U.S.C. Sec. 19) states that the following would be required, if qualified and, for Cabinet secretaries, if having been confirmed by advice and consent of the Senate, to act as President until such a time as a President has qualified:
The Speaker of the House of Representatives
the President pro tempore of the Senate
the Secretary of State
the Secretary of the Treasury
the Secretary of Defense
the Attorney General
the Secretary of the Interior
the Secretary of Agriculture
the Secretary of Commerce
the Secretary of Labor
the Secretary of Health and Human Services
the Secretary of Housing and Urban Development
the Secretary of Transportation
the Secretary of Energy
the Secretary of Education, and
the Secretary of Veterans Affairs