If it's happening when he's excited or active, this is very likely caused by a collapsing trachea. It's VERY common in this breed. I would want to see the vet to confirm this. Most dogs with this condition do not need treatment (aside from anti-tussins) and live a very normal life.
Aside from that, heart conditions can also cause a cough with exertion so I would want to have the vet pay a little close attention to the heart.
This CAN become a habit, particularly if he has been doing it this long. When he starts to cough, be sure to distract him with a toy or even just affection so that he will stop. If it's a habit, this will help.
But I would definitely want to look further at tracheal issues and the heart.
Respiratory illnesses are also a common cause of coughs but if your dog has not been exposed, I would not jump to that first.
You can read more about robitussin and its use dogs, including dosage information and the precautions:
Let me know if you need more help.