Trump already believes elections are crooked, thinks there is massive amount of voter fraud. If he wins, he will say it is because he is perfect even though there was voter fraud. He doesn't know how elections are run so he speaks of that which he does not know. He knows not how mail-in ballots work; he confuses the application to get a ballot with the actual ballot; he doesn't know the difference between those two.
Although I know how each area of an election works in counties and how elections in a county can have to re-do an election, I have not looked into how a US President can legally question national election results, however, remember Florida when that election between Bush and Gore went to the Supreme Court and they determined Bush won that election. So, we know how one state election can get to the Supreme Court. Can Trump question the results of each state, claiming voter fraud? I will look that up.
An aside: The Election Code of every state can be read on the Secretary of State's website in every state in this country.