I am not medical, but I have been through it with DS, it sounds like overflow diarrhoea, in which case there most be blockage, harden poo inside the rectum expands and the new wet poo leaks around it, you son will have absolutely no control over this.
See your GP, for a referral to a Paediatric Gastroenterologist. Some are better than others the first one we saw, completely useless I have to say, the second was absolutely amazing and got to grips with the problems immediately and DS has been fine ever since.
I was honestly at my wits end before we saw amazing paediatric Gastroenterologist, my DS was 12 by this point, and I felt desperate.
And we have been going through this for years and no one had been able to solve this issue.
The first thing the consultant said was to examine DS just by feeling his tummy, NOT up his bum as had happened in the past.
Consultant took the time to explain to us very simply what was going on.
The plan was to clear impaction, with Movicol paediatric mornings and Dulcolax evenings.
Messy but did the job!
He now has 2 sachets movicol daily in the morning and then 1 5ml spoon of Dulolax every evening.
DS also had allergies testing as sometimes allergies can cause constipation, they are came back clear.
The consultant said, for every year of constipation equals a year of medication and if it’s stopped to quickly we would soon be back to an acute stage. YOU MUST NOT MISS A DOSE.
It is not a quick fix, as the rectum expands and your child loses the feeling that you and I have when we know we need to poo, but with the medication keeping your DS regular, that feeling will return in future.
Good luck OP, I know how worrying this problem is, and it is way more common than you think, but with the help of the right specialist it can be solved.