OP, I'm going to re-post some brilliant advice from Neolara from another thread - it has helped many, and you might want to give it a go:
"My dd was a nightmare potty training and I had similar experiences to you. It used to enrage me more than anything else about raising my kids. I ended up talking to a very experienced nursery teacher about this and after following her suggestions, things improved literally overnight. I'd say we cracked it totally within a few days after at least a year of hell. It also worked on dc3 when she went a period of pooing in her pants.
OK, this was the plan......
Firstly, I was to tell my dd that big girls do poos in the loo. Mummy does. Granny does. Teacher does. That's just what happens. Then don't go on about it any more.
Secondly, if she did a poo in her pants, I was totally to ignore it. I might make some comment like "Oh, it's a bit smelly in here" but then walk away. After a while, pooey pants start to hurt and dd would come to tell me what had happened. No chasing her round the house trying to get her to get changed (which was a lovely game)
Thirdly, if she had done a poo in her pants, I would take her to the bathroom, hand her the wipes, tell her she had to clean herself up all in an absolutely-I'm-not-at-all-bothered-about-this kind of way. I might stay in the bathroom, doing a bit of cleaning, but I wouldn't look at her/ comment/ give praise, hurry her up /help her etc. At the end, once she'd had a really good go, I'd give a quick wipe. Dc3, who was a bit more fiesty than DC1, would stand in the bathroom screaming at me hysterically at this point, so I'd just walk away and leave her too it. If she was naked and covered in poo, I wouldn't let her leave the bathroom until she'd cleaned herself up. Initially, the screaming could go on for 20 mins or so but after a day or so she just stopped.
Fourth, once she was all cleaned up, I'd give absolutely no praise but tell her to go find some clean clothes and put them on.
Repeat the next time.
Literally, it took 48 hours and things were completely sorted. The trick is to totally make it your child's problem and nothing to do with you. Sort of, "that's fine darling, you do a poo in your pants if you want, but then you have to deal with it" with a tinkly laugh. You have to be utterly and totally zen about it. If they get even the slightest inking that what they are doing is getting to you in any way, you are doomed! A cross look, a tense tone of voice, a raised eye-brow - they are all ammunition for your dc.
If your dc has constipation issues with leakage then obviously this method won't work. But if he is just being bloody minded, the above approach is definitely worth a try.
Good luck!"