Gaurd: We need a list of your crimes.We can do this the easy way or the hard way.
Chavo:The easy way
Gaurd: i thought so, Name?
Chavo: Domingo Chavo
Gaurd: when did you first work for the rebels?
Chavo: At age 10
Chavo: my parents had just died, i needed some money.
Gaurd: what did you do for them at first?
Chavo: Steal things: Money, food, ship parts.
Gaurd: When did this stop?
Chavo: When i was 15 years old.
Gaurd: what happened then?
Chavo: They gave me a ship and i became a bounty hunter.
Gaurd: What of your later crimes, Harrasing impirial ships, Attacking impirial bases, Murdering Impirial Officers.
Chavo: Is this a list or a court?
Gaurd: It could become a court.
Chavo: My ship had Rebel Markings, smugglers hired me to cause distractions, including harrasing ships
Gaurd: Attacking Bases?
Chavo: the rebellion hired me *shrugs* they were jobs
Gaurd: Murdering Impirial officers?
Chavo: jobs and self-defence
Gaurd: thats all for now.
*gaurd stuns chavo*
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.