Al Gore won a majority of the popular vote but he lost a majority of the Electoral vote. That is how George W. Bush was elected President in 2000.
2000 popular vote:
Bush-50,456,002
Gore-50,999,897
2000 Electoral vote
Bush-271
Gore-266
The "popular vote" is only a point of interest, not a valid qualifier in a Presidential election. No government election authority can utilize it.
IOW, there is no such thing as a national election.