Hi there,
I wonder whether he could be having trouble with his anal glands, these are little sacs which sit just inside the anus at a 4 and 8 o'clock position, they secrete a smelly fluid on to the poo, for scent marking. Some times they can get impacted or blocked which causes irritation, some times you will see dogs scooting on their bum, or chewing around the base of the tail.
These can easily be emptied at your local vets, certainly if he has diarrohea this will agravate the problem.
I woud try this as a first route, but if it continues then it would be worth further investigation.
Regards,
Selena Carnell VN
Up to 70% off pet products at Entirely Pets Click Here