Legal means complying with the letter of the law.
Legitimate means complying with the spirit of the law.
Donald Trump was elected legally by the electors. Since he was elected deceptively with Russian help and lies rebroadcast by the media, he is not a legitimate president. I suspect that we will find in time that not all votes cast for Hillary were counted and we already know that the GOP made strenuous efforts to prevent Hillary voters from voting.