I was in this situation with my DS2, below is the thread I started with lots of great advice.
I in the end took him to an OT as I was so stressed, he was starting 4yr Kinder in the new year and he was still pooing in jocks only.
I used to have to walk away, regroup so I could approach the clean up calmly.
In the end I just had to leave him in jocks and about half way through 4yr old kinder it all just clicked into place.
One of the kids in kinder was talking to me and DS2 as I had to go to kinder to clean DS2 up due to a pretty enormous poo in his pants. The child was not nasty or mean, just curious, just asked DS2 why he didn't poo in the toilet like the rest of his friends? I think that conversation was the breaker for DS2 and he didn't have any accidents for the rest of the Kinder year. We still have the odd one here and there, maybe every 6mths or so, usually as he is running to the toilet and hasn't been able to hold on.

Toilet training DS2 was one of the most stressful and frustrating times of my life, I hope it improves for you

https://www.bellybelly.com.au/forums...o+in+his+jocks


ETA:

A GF or mine took the softly softly approach with her very reluctant DS. First she got him confident to sit on the toilet with a nappy on and do a poo. Then after he got that idea, she then cut a hole in the nappy at the base and got him confident sitting on the toilet doing a poo that way and then after that they took the nappy completely off after he was happy and confident to sit.
For alot of kids, it's foreign sitting down to do a poo, when you think about it, when they poo in their nappy they go and find a quiet place and stand an poo. For some kids the idea of sitting is frightening and without the security of a nappy, they feel like something is falling out and don't like the sensation or the splash back.