You have given all the important information in your question. This is a common problem in children with chronic constipation. What you are seeing when he poops in his pants is the so-called overflow stool. This is stool that leaks past the constipated hard stool in his colon. The problem may actually have started a while back when he developed a fear of passing stools, probably due to a small tear in his anus caused by passing a hard constipated stool which then made it painful to pass stools at the time.
What need to be done now is to help him to clear the constipated stool in his colon. Your son must be seen by a paediatrician as soon as possible. He will probably need what is called a Fleet enema and it may even be necessary to remove some of the constipated stool manually if it is difficult to budge the stool even after the enema. After that he will need to be on a long term stool softener such as Duphalac Liquid. There are several brands available. This is quite safe to use for several months if needed. Your son must sit on the toilet every day after he has been treated so that he can re-establish the habit of passing stools normally.
The information provided does not constitute a diagnosis of your condition. You should consult a medical practitioner or other appropriate health care professional for a physical exmanication, diagnosis and formal
advice. Health24 and the expert accept no responsibility or liability for any damage or personal harm you may suffer resulting from making use of this content.