Here is the twelfth amendment to the U. S. Constitution with regard to the electoral college. Popular voters do not elect the president and the vice-president of the United States directly. The Electors of each state vote for the president and vice-president of the United States. At first, the popular voters elect the Electors of each state. However, the popular vote for the president and vice-president must be held. It is possible that the loser candidates could have the majority of popular votes, however the electors of each state must vote according to the popular vote of that state. Each state has a certain amount of electors based on the population of each state. The electors’ votes for each state are signed and certified and sent the the President of the U.S. Senate, who counts the electoral votes. There has to be a majority of 270 electoral votes for the presidential candidate and for the vice-presidential candidate. There are a total of 538 electors in the United States. All of the electoral college procedures are lawful and specified in the 12th Amendment to the United States Constitution as follows:
The Electors shall meet in their respective states, and vote by ballot for President and Vice-President, one of whom, at least, shall not be an inhabitant of the same state with themselves; they shall name in their ballots the person voted for as President, and in distinct ballots the person voted for as Vice-President, and they shall make distinct lists of all persons voted for as President, and all persons voted for as Vice-President and of the number of votes for each, which lists they shall sign and certify, and transmit sealed to the seat of the government of the United States, directed to the President of the Senate.
The President of the Senate shall, in the presence of the Senate and House of Representatives, open all the certificates and the votes shall then be counted.
The person having the greatest Number of votes for President, shall be the President, if such number be a majority of the whole number of Electors appointed; and if no person have such majority, then from the persons having the highest numbers not exceeding three on the list of those voted for as President, the House of Representatives shall choose immediately, by ballot, the President. But in choosing the President, the votes shall be taken by states, the representation from each state having one vote; a quorum for this purpose shall consist of a member or members from two-thirds of the states, and a majority of all the states shall be necessary to a choice. And if the House of Representatives shall not choose a President whenever the right of choice shall devolve upon them, before the fourth day of March next following, then the Vice-President shall act as President, as in the case of the death or other constitutional disability of the President.[Note 1]
The person having the greatest number of votes as Vice-President, shall be the Vice-President, if such number be a majority of the whole number of Electors appointed, and if no person have a majority, then from the two highest numbers on the list, the Senate shall choose the Vice-President; a quorum for the purpose shall consist of two-thirds of the whole number of Senators, and a majority of the whole number shall be necessary to a choice. But no person constitutionally ineligible to the office of President shall be eligible to that of Vice-President of the United States.