K.B.
I had the same problem with my middle daughter, somewhere around age 3. My pediatrician recommended that we go in stages: (1) when it's time to poop, he has to go into the bathroom to poop. He can sit anywhere he wants, squat, whatever, in his diaper, but it has to be in the bathroom. (2) after a few days, change so he has to sit on the toilet, with the seat closed, in his diaper, when he poops (3) after a few more days, he has to sit on the toilet with the seat open, but can still wear his diaper. (4) last step should be obvious by now! It was about 8 years ago, so I don't remember exactly how long it took, but it worked like a charm. Probably took about 2 weeks or so. Good luck!