Your dog has worms. You should take him to the vet and get him a deworming shot. In
the future, you need to give him one of many commercially available deworming treatments
regularly so that he doesn't get them again. You should also have him checked for heartworms,
which are potentially fatal..