Don't worry, he will not be going poop in his diaper forever. Pooping IN a toilet is OFTEN the "last" of the whole toilet training phases to be mastered. ALL my friends kids did that too, at that age, and my daughter too. Its common.
Just from personal experience.. you do NOT NOT NOT want to make pooping a battle... as you see, he is already withholding it... and getting constipated. IF he gets more seriously constipated due to the emotional stress of it and expectations upon him AND the biological PAIN it causes... you will have a more serious and BIGGER problem.
I know, because this happened to my daughter. We then had to take her to a Pediatric Gastroenterologist.... because she was SO constipated and then withholding her poop and the constipation became THE habit... and it turned into a vicious cycle.
PER the Pediatric Gastroenterologist...whose patients are MAINLY toddlers in toilet training, he said that you have to lay off of it. LET the child do it in their own time. The "constipation" in a toddler is completely avoidable.... if they don't get pressure to poop on a toilet. Constipation in a toddler then becomes an "emotional" derived PROBLEM and then a "medical" problem for which he then has to treat the child with various medical treatments. The Doctor said... that once the vicious cycle of constipation starts... it is hard to "stop" it... because it causes pain and emotional discomfort IN the child... and it can take LITERALLY MONTHS to UNDUE all of this.
For my daughter... it took about 4 months, just for her to "believe" that pooping will not hurt and that it will be okay and her poop won't be 'hard' anymore. She had become "afraid" to poop.
We did not "pressure" her to poop IN a toilet... BUT, just the thought of it caused her great anxiety. And this happens in many toddlers.
So, the gist of it is, per the Specialist we saw... is to hang loose about it... do NOT pressure the child to poop in a toilet. Otherwise, they will regress and the whole natural progression of it, will be under-mined, "psychologically" for the child.
MANY MANY toddlers, FINALLY go poop in a toilet one day. NOT on 'our' terms or when we think they should... it will happen when they are ready.
It was so sad to see my daughter go through this... and its hard to correct the problem, once constipation and "withholding" of their poop occurs... it becomes a bad habit that is put upon them... not that they "want' to do it on purpose. It is just a coping mechanism for them showing us that they are not ready yet, or maybe don't know how yet.
There is not rush to it all... per our Doctor, the Gastroenterologist.
You do NOT want the child, out of desperation, to start to withhold their poop... for days (as some toddlers will do)... it is VERY painful, the poop becomes rock hard and can't pass without tearing their anus, and it can rupture their innards as well as it builds up and bulges.. and cause other medical problems and complications.
Treats, bribes, incentives, charts will NOT be a magic solution to it... for many kids these don't work... because pooping is part an emotion basis and part physical...
All the best... don't worry,
Susan