he is 7 months old and is potty trained... when ever he dont get his way or i ignore him or walk away from him, he will go under my bed and poop..how do i stop this i have tried everything by crating him when he does this... i dont understand bc my female i a month youger and potty trained and she does not do this... i dont know what else to do... please help me....

Have you completely cleaned the carpet under your bed with an enzymatic cleaner so there is NO scent whatsoever?

I would put boxes or something around the bottom of the bed so he can't get under there. Then he may forget the behavior and his "favorite spot."

If he is not fully potty-trained he should NOT be alone in the house or your room. He is not trustworthy yet. Some take a very long time. You must supervise him all the time and not allow him to do it. Catching it later doesn't do the job, you have to catch him in the act and continue training him to go outside.

"When he is mad at me" is very.... human-like. Dogs don't quite have that sort of emotion. You may be misinterpreting something else. When does he do it specifically?

"Always remember that you are absolutely unique. Just like everyone else."