There are many things that can cause a dog to cough like this. They include:
Infectious diseases (viruses, bacteria, fungal diseases, parasites, etc..)
Chronic Obstructive Pulmonary Disease
The list is really quite long. The first thing that you should do is take him to the veterinarian for a physical examination. The vet will check him out for any sign that he may have an infectious disease, will listen to his heart to see if he has a murmur, and will also likely do a quick blood test to see if he is positive for heartworm disease. If signs of infectious disease are present, the first thing that is tried is some antibiotics. This will clear up a bacterial infection, and help prevent against a secondary one from forming if a viral agent is causing the problem.
If the antibiotics do not work and the heartworm test is negative, then the vet will next recommend doing X-rays of the chest to look for signs of pneumonia, cancer, and congestive heart failure. Further blood testing may be necessary to determine if this is a fungal problem.
I am attaching a client information handout that I use in my practice that discusses the causes of coughing in more detail. I hope that you find it useful. Click Here
I hope that this information is of help to you, and I wish you the best of luck with your dog.