A very good source for helping your child take responsibility for his behavior is a book called "Love & Logic" for you and dad to read. It will help you as a parent to learn about becoming parents who can help grow your children without causing a division in the relationship.
As he continues the behavior that causes mom and dad to react he gets attention, no matter how good or bad the attention may be. The problem of poopy pants is mom and dad's, as he watches you clean up the "problem" he created. He has control of the problem, he can be in control of the resolution.
I would highly suggest that you read the book LOVE & LOGIC.
Personally I would let my son know that I don't like the smell of poopy pants and that when he cleans himself up then he can come and be around and play. If he doesn't know how then I would show him what expectation of being clean is. I would stand back and give directions, *gently of course, (this empowers him)I would encourage him to deal with his accidents so that in the future if this occurs again he has this new knowledge on how to resolve the problem like a big boy!