Hi! My oldest son (now 9) had the exact same problem! He was holding his poop in so bad, that he would go in his sleep, and it was super hard and full of blood. I brought him to Children's Memorial to a gastroenteroligis, who put him on Miralax ( which is now over the counter ). It helped soften his poop, but he still wouldn't go. He was four at the time. The gastro told me to have him sit on the potty after every meal, for fifteen minutes. Which again did nothing! So, I ended up making a poop chart. If he went poop in the potty, five times in a row, I would buy him a present ( he really wanted a game boy advance at that time ) That seemed to work!
I also have a three year old, who pees on the potty, but refuses to poop. I'm a littly gun shy when it comes to pressuring him about it cuz i'm scared to have the same pooping problem with him as with my oldest.
My opionion: I would just take it easy with him, be patient, and everytime he has an accident, tell him it's ok, and then ask him to try the potty next time. I am a true believer of believing that kids will do it when they are truly ready.
I hope this helps! Good luck!