Hi Ashersmama
Just some things that may be relevant in your situation:
1. When babies suck/feed, it starts the digestive system working, which MAY be why your bub is pooing when he feeds.
2. Have you changed your diet much recently? If you are BFing, then something YOU are eating could be upsetting his stomach.
3. My mother believes (so this MAY just be a myth) when babies are teething, their poos can change a bit.
4. If he's having solids, his poos may be a bit harder, so he might be having more trouble with pooing- which may be leading him to wake up (that is, his pooing wakes him up, as opposed to he wakes up and then poos).
I don't know how to get him to stop pooing every time he feeds, but it may just be a stage while he's teething.
If it's a big problem though, I'd speak to your GP or child health nurse for advice.
Good luck with it all!