Sometimes a person will defecate or poop when they die but not always.
If you have poop in your bowels when you die then your bowels muscles will relax and then release the poop that is inside your bowels.
Also if you have pee in your bladder then you will also sometimes release your bladder and pee on yourself when you die.
You won't know it anyway though because you'll be dead but the people who deal with dead bodies deal with the poop and pee all the time.
And the poop and pee is not the most nasty thing when it comes to dealing with dead bodies so it doesn't really bother them to clean it up.