Hi A.,
When I was a nanny, I had a family whose son --of similar age-- was doing the same thing. This usually occured after his coming home from preschool. (Is your son doing this at his preschool-- I saw a previous post that he was attending a program-- just wondering if this is only happening at home or both places.)
Because kids so often won't tell us the root of the cause of their regression, I make it a point to do some observation before trying to correct the problem. Here's one idea:
Make a little chart or some notes for yourself. Nothing fancy. This is primarily to notice for patterns. You want to keep track of when, during the day, that he's pooping in his pants, and how often. Is he going into a corner to hide, as many do, or just doing it right out in the open? What sort of activity is he engaged in? (is his body responding to these activities as 'cues' for pooping, because he's getting into a habit?) And what sort of mood is he in? I only ask because some children might do this when they feel less in control of a situation than they would like, and this is one way to have some power. Not a preferred option, of course, but from your description of his holding it when he is placed on the toilet and then going later suggests that there may be some stress; the muscles of elimination require us to relax for them to be able to work. If you are hanging out in the bathroom, waiting for him to poop, it will likely shut down his ability to do so, much in the same way that a stressed mother in labor can actually have contractions and dilation stall. (If you've read Ina May Gaskin's Guide to Midwifery, this isn't a big leap in thinking: she calls it "sphincter logic". )
If it were me, I'd look at the notes after a few days (4-5) to notice any patterns. If he's regularly soiling his pants at 2:00, I'd invite the child into the bathroom at 1:50 (don't ask him to go, Tell Him "time to go poop now" and make sure he heads in there). Have a basket of fun, small things he might like to use while he's waiting for his body to do its work (books, magna doodle, etch-a-sketch... ), and a timer set for 3-5 minutes. Let him know that when the timer goes ding, he can come out. I'd encourage you to keep the time short. Then, if he hasn't pooped, wait maybe 10 minutes or so and send him in to try again.
Also, when there are accidents, in lieu of time out, have him stay with you while you do the cleanup. He will need to help: he can put the poopy pants into a plastic bag for the laundry, stay there (in the bathroom) while you do cleanup; have him hold open doors for you... in short, he can't go play until you can get back to what YOU were doing. If he's choosing to mess in his pants, this will make it less convenient for him. I would caution against overtalking it, because while simple statements are fine, long lectures and warnings only add to the attention. Just simply "It doesn't take so much time to clean up when you poop in the potty." or "You know, when you use the potty to poop, you have more time to play, because you won't have to help me clean the mess up."
Let us know how this goes... this is a tough one. Some kids go back and forth with this for a while. I also wonder, is he getting a lot of attention when this happens? Even negative attention by your being upset is a way to spend time with you, so if you think this might be the case, find some other times of day to spend time with him, without interruptions. (And I have to ask, is there a new baby in the house, or on the horizon? Sometimes, older children will do this to 'relate' to siblings who aren't using the toilet yet.)
Good luck!
H.