Legitimacy is not determined by majority vote. It's determined by the people who don't like the results for whatever reason. If the vast majority of them accept that the elections were legitimate, they were legitimate. If a substantial minority of them don't accept the results, the legitimacy is questionable at best, and the country is in a lot of trouble.
Legitimacy is fundamentally about trust. Trust that the elections were fair, even if you don't like the outcome.
If your candidate won, your opinion on the legitimacy doesn't matter much. If your candidate lost, your opinion matters more. If you think that the elections were legitimate, your opinion doesn't matter much. If you think they were not legitimate, your opinion matters more.
It doesn't really matter if the elections were fair. If the losers don't trust the system, the elections were not legitimate.
A society can handle a small number of people who question its legitimacy. Maybe 5%, maybe 10%, maybe even 20%, depending on the overall level of trust. If too many people don't trust the system, the society doesn't really work anymore. Laws, constitutions, and other institutions are only as strong as people's faith in them.
it's a fact that more people considered it legitimate, otherwise the candidate in question wouldn't have won the election.
let me ask you this about your "fact" how "many people" didn't consider it legitimate? should be easy to answer since it's a fact.