Stool withholding... commonly occurs in toilet training toddlers.
MY own daughter did that... we did not force her to poop in a toilet... but just the idea of it gave her much anxiety and stress.
She withheld and got constipated and pain.
We then had to take her to a Pediatric Gastroenterologist... he said this is common.... and that it will take at least 3 months to undo.
Because, it is a medical problem as well as an emotional based problem-- the more a child withholds pooping, the harder the poop gets, then the more painful it gets internally and when coming out... and then because it hurts so much, the child will then withhold it even more. It is a vicious cycle.
It is DANGEROUS.... to withhold poop as well. A child can get bulging bowels and "encopresis." These are then involuntary stool soiling. And of course, their constipation can get lots worse.... and internally, it is harming their system.
For my daughter... the Doctor gave us a prescription of things to do for her and give her.
BUT... he said, NEVER give suppositories ... not in a child.
And, to just LET the child poop... in whatever way they can and is more comfortable for them... the POINT is that they poop. HAVING to poop in a toilet... is not important... because they will, when ready... do it on their own. ON their own. Just not yet. They are not ready.
Holding poop... is NOT an issue of the child being "stubborn" irritating. It is common that a child 'master' pooping, last, in the process of toilet training. It causes anxiety/stress.
I would, take him to the Doctor. An give him natural stool softeners.... a tad bit of prune juice, pear juice, water, etc.
All the best,
Susan