M.G.
I was going to say, if it's poop - it's often a medical reason - nothing serious, usually a form of constipation. Have you mentioned it to his pediatrician?
The thing is, it might have started out as a minor problem but by giving it all sorts of attention, you may unwillingly have freaked him out. Some kids have a set back (often constipation) then react to being scolded by holding it in. It's actually not that uncommon. If you yelled at him ... you may just want to drop it for a while. But definitely get him seen if it continues and you think there may be a problem. You don't mention what his BMs are like.