One of three scenarios...
1) A wildly popular incumbent president (70-80% approval rating) presiding over a booming economy and a peaceful world stage plunders a terrible opponent.
2) A wildly unpopular incumbent president (15-25% approval rating) presiding over an economic depression and/or an unpopular war gets plundered by a flawless challenger.
3) A colossal third-party candidacy takes root and splits one of the parties in half, resulting in the other party benefiting from the fracture.
1) The last Presidents to get 500 electoral votes were incumbents getting re-elected against very weak opponents -- Reagan against 'in honor of long, loyal, and meritorious service to his party' Walter Mondale in 1984, Nixon against a nominee (George McGovern) portrayed as a dangerous radical in 1972, and FDR against Alf Landon who practically served as token opposition in 1936. The incumbent President had already won by a large margin getting elected and seemed to have solved some big problems.
Donald Trump will not be in this position, having been barely elected in 2016 and probably creating more and worse problems than he solved.
2) This is worse failure than incumbents Hoover and Carter. You might see this only if the President is seen as a criminal and is facing mass protests. Trump getting fewer than 39 electoral votes? I don't see this happening.
3) Possible but unlikely. Even Perot failed at that level.
Anything else? Rigged election? I don;t want to imagine the circumstances in which this is possible.