https://en.wikipedia.org/wiki/President-elect_of_the_United_StatesPresident-elect succession
Scholars have noted that the national committees of the Democratic and Republican parties have adopted rules for selecting replacement candidates in the event of a nominee's death, either before or after the general election. If the apparent winner of the general election dies before the Electoral College votes in December the electors would likely be expected to endorse whatever new nominee their national party selects as a replacement. The rules of both major parties stipulate that if the apparent winner dies under such circumstances and his or her running mate is still able to assume the presidency, then the running mate is to become the President-elect with the electors being directed to vote for the former Vice Presidential nominee for President. The party's National Committee, in consultation with the new President-elect, would then select a replacement to receive the erstwhile Vice Presidential nominee's electoral votes for Vice President.
If the apparent winner dies between the College's December vote and its counting in Congress in January, the Twelfth Amendment stipulates that all electoral ballots cast shall be counted, presumably even those for a dead candidate. The U.S. House committee reporting on the proposed Twentieth Amendment said the "Congress would have 'no discretion' [and] 'would declare that the deceased candidate had received a majority of the votes.'"[6]
The words president elect appear four times in the Constitution, and they didn't appear until 1933, when the Twentieth Amendment, which contained a provision addressing the unavailability of the president elect to take the oath of office on Inauguration Day, was ratified.[1] Section 3 provides that if there is no president-elect on January 20, or the president-elect "fails to qualify", the vice president-elect would become acting president on January 20 until there is a qualified president. The section also provides that if the president-elect dies before noon on January 20, the vice president-elect becomes president. In cases where there is no president-elect or vice president-elect, the amendment also gives the Congress the authority to declare an acting president until such time as there is a president or vice president. At this point the Presidential Succession Act of 1947 would apply, with the office of the Presidency going to the speaker of the House of Representatives, followed by the president pro tempore of the Senate and various Cabinet officers.
Horace Greeley is the only presidential candidate to win pledged electors in the general election, and then die before the presidential inauguration; he secured 66 votes in 1872 and succumbed before the Electoral College met. Greeley had already clearly lost the election and most of his votes inconsequentially scattered to other candidates. The closest instance of there being no qualified person to take the presidential oath of office on Inauguration Day happened in 1877, when the disputed election between Rutherford B. Hayes and Samuel J. Tilden was decided and certified in Hayes' favor just three days before the inauguration (then March 4). It might have been a possibility on several other occasions as well. In January 1853, President-elect Franklin Pierce survived a train accident that killed his 11-year-old son. Four years later, President-elect James Buchanan battled a serious illness contracted at the National Hotel in Washington, D.C., as he planned his inauguration. Additionally, on February 15, 1933, just 23 days after the Twentieth Amendment went into effect, President-elect Franklin D. Roosevelt survived an assassination attempt in Miami, Florida. The amendment's provision moving inauguration day from March 4, to January 20, would not take effect until 1937, but its three provisions about a president-elect went into effect immediately.[1] If the assassination attempt on Roosevelt had been successful then, pursuant to Section 3 of the amendment, Vice President-elect John Nance Garner would have been sworn in as president on Inauguration Day.