How is Donald Trump a president when Hillary Clinton had more votes than him?

She had 65,853,514 votes whereas Trump had 62,984,828 . how is Trump a president when he had less votes?
Update: I am not American and I dont live in the USA that is why I am a bit confused.
Update 2: This information is from Wikipedia. Nobody can edit that page, it is protected so this isn't fake.
20 answers 20