It's called Coprophagia. Here's some info I found on the topic hope it helps but you should still take him in to see a Vet.
"Although no conclusive evidence exists regarding why dogs roll in other animal's waste (as well as dead animal parts), it seems reasonable to assume they do this to provide themselves with a sort of camouflage. Animal waste carries a rich supply of pheromones, potent chemicals that reveal its source's species, sex, reproductive status, and even social rank. Because many mammals rely on scent rather than vision to identify each other, a dog who rolls in waste or other debris from a member of another species could conceivably fool members of that species into accepting it as one of their own. In the wild, this would enable a predatory dog to get closer to a potential meal than it could otherwise, thereby improving its chances for survival. Because of the survival advantage the behavior conferred, it would become firmly entrenched in the wild dog's repertoire and persist even after domestication.
Dogs who eat other animals' waste usually eat that belonging to a species possessing different nutritional requirements. For example, cats require a much higher protein diet than dogs, and the horses, cattle, sheep, deer, and rabbits which serve as the sources of the meadow muffins and field raisins so relished by many dogs feed on grasses and plants. Given these different diets and digestive products, these other animals' "waste" isn't waste to the dog at all, but rather an alternative food source. Moreover, because this material has already received some processing, it may provide the dog with nutrients it couldn't gain from eating that animal's food directly.
Dogs who eat their own stool also may do so because they perceive it more as food rather than waste. However, the behavior may result because the dog can't completely digest its food for some reason. For some dogs, a lack of the necessary digestive enzymes to break down the nutrients in certain kinds of food may cause the problem. Others may experience problems that interfere with their ability to absorb the nutrients from their digestive tracts. A third group may eat stool simply because it's become a habit. Because medical or behavioral problems may cause the problem, dogs who eat their own stool should be examined by a veterinarian.
Dogs who eat other dogs' stool generally do it for one of two reasons. Occasionally a very timid dog may eat another dog's stool in an attempt to remove the intruder's "mark" from its own territory. Other dogs who eat dog stool may do if the other animal suffers from the aforementioned digestive problems."
Buy a food additive - such as Deter or Forbid - or dry kibble that makes feces unappetizing to dogs, and add it to your dog's food if he's into eating his own. These products contain a chemical, monosodium glutamate, that is made bitter tasting during the digestive process.