M.B.
I'd probably just give it a few months, maybe he's not ready. Going poop in diaper but potty on toilet is very common.
You could try the magic diaper technique. Cut the 'butt' out of some diapers. When he has to go poop, put the diaper on with a hole in the rear (so the poop can come out). Have him sit on the potty with the diaper on. When the poop falls through the hole tell him it's a magic diaper and he went poop on teh big potty! Have a party and celebrate. This way he has his security, the diaper, but the poop still goes in teh toilet. This helps transition them when they are scared to go without their diaper on. Eventually you can get rid of the diaper altogether. Good luck!