Why are guys so moody?

My boyfriend can be very moody! I know he's really stressed out right now. He gets mad at me over stupid things an like ten Min's later he wants to be nice to me again. I don't understand him sometimes. o0 an one night he was really mad an told me I never make him feel better when he's mad. What are some things I could say to him to make him calm down when he's mad?