S.G.
Sounds like a bit of regression because there is a baby in the house. You can't punish him for doing it. He sees the baby getting more attention for wearing a diaper so he wants it too. Normal behaviour. Try rewarding him for when he does go to the potty. Potty candy-2 M & M minis, 2 smarties or a potty chart with stickers of his favorite TV character. http://www.pottytrainingconcepts.com/CTGY/FREE-Potty-Trai...
This is a great website for FREE downloadable potty charts for kids. I used the very last one for my son and ony had to print out two! I don't know if that was the ticket or what (we also used potty candy) but he woke up one morning and decided to use the potty all the time!! Poop is still a working progress but he is getting there.
But just be patien and understanding of your son. Maybe try to give him a little more attention when the baby is naping so he doesn't feel as left out or try to get him to help you more with the baby. Brings you diapers, wipes, butt cream, helps you feed him a bottle, etc.
Good luck!
S.