*The final members of Greer's team arrive at the hospital*
Greer: As you all know, the republic has been growing corrupt. A group of senators ordered the destruction of corusant. The same group of senators are now trying to kill Deac Starkiller. We will gaurd him as much as possible. I already have O'Connor gaurding the east from deac's room. Dominguez, Price, Deiter, you guys set up your rifles to the north, south and west. Perez, I need you to hack into the cameras and send the signal to my datapad. Caruso, CLark, you guys cover the entrance. Any questions?
*There were none, they were trained proffessionals and set up shop swifty.*
Vader's wife was very pregnant when she died 19 years ago. All of a sudden a 19 year old who is very strong in the force and has a distinct resembalance to him in his younger days rolls in from Vader's home planet with his old Master Obi-Wan (Who was the ONLY other person preset at the time his wife died. And to boot, the kid's last name is Skywalker.
So in answer to your question, he knew Luke was his son because his name is Darth Vader, and not Darth Retard.
-Forum post on why Vader knew Luke was his son.