The first thing to know is that one should aim the syringe towards his cheek after putting it in his mouth and not towards the back of his mouth. My trick is to squeeze a little medicine towards his cheek and then immediately put a pacifier in his mouth. Repeat several times. He'll suck on the pacifier and swallow the medicine.
Usually after a few times the baby figures out how to swallow the medicine without needing the pacifier to help him.