With 99% certainty he is severely constipated, with faecal impaction.
Think of the rectum, the last part of the colon, as a stretchy squeezy hosepipe held closed by a donut at the end. It's meant to sit empty, then when some poo comes along, that's when you feel the need to go to the loo, and empty it out again. When a child is becoming constipated, not all that poo has been pushed out before the next poo comes along, so it starts to build up. As it builds up, the gut sucks more water out of it making it harder. Then the hard poo starts stretching the wall of the rectum, which stretches the muscle fibres, making them much less good at pushing poo out. There is a constant sensation of needing a poo, so the brain subconsciously (and NOT on purpose) turns off awareness of the signal of the need to poo, so they don't know when they need to go. The hard rocks of poo pressing down on the donut at the bottom of the rectum (the anus) open it up, like the head on the cervix in labour, so if they're about to desperately need a poo they can't hang on. All this time, there is still food and drink going in the top end, making more liquid poo that hasn't had all the water sucked out of it yet. This gloopy poo reaches the blockage of the old hard rocks of poo, but is still being pushed down, so leaks round the edges, and causes completely unexpected accidents.
In order to treat this there are a number of vital steps:
- Clear out all the old rocks of poo, emptying out the rectum. This is generally best accomplished with movicol/laxido. You need to give absolutely shedloads of this until they have been pooing liquid, in vast quantities, for several days. Do not stop early just because they've started pooing. Usually need to miss a few days of school to achieve this.
2)Once the old poo is cleared out, you need to keep the rectum either empty, or only containing soft poo. This means you must not stop the movicol/laxido, but only reduce gradually, aiming for daily pain free passage of soft squidgy poo.
3)Encourage the poos to go down the toilet. Sit on the toilet for 5 minutes after every meal. Use a foot rest to get knees above hips. Encourage relaxation of the anus by blowing bubbles.
4)Encourage fruit/veg/lots of fluids in order to gradually come off the movciol
5)Behavioural. Star charts/rewards for things the child can achieve with difficulty. So don't offer rewards for clean days when he doesn't know how to do that. Rewards for cooperating with clean up. Rewards for taking the movicol. Then rewards for toilet sitting. Then for poo going down the toilet. Then work up to rewards for clean pants.
It's actually a really common problem, and not his fault, but this is eminently sortable. Oh, and lactulose is bloody useless for this. We used to use it before movicol was invented, and no one ever got better.