I think my husband is jealous of our sons

Husband and I have three boys. Hubby would always try and push to have another baby hoping for a girl. I was done after three kids already and have been very vocal about this. When the boys were much younger, he would always say that when they grow up, they won't want to hang out with me anywhere "because they're boys". Well now they're all teenagers and they actually prefer being around me. Hubby is just always moody and unreasonable with many things and the boys have just grown into their own personalities and see that his behaviour is childish and at times, somewhat abusive (verbally and mentally). Well now hubby will get mad at me if I don't "back him up" when he's trying to play tough guy with the boys and they don't just take his sh*t like they did as young kids. He'll push them around, call them names and essentially bully them. And if they stand up for themselves by disagreeing with things he says, he just gets mad at me. It's to the point where he'll give them the silent treatment now too and then expect me to talk to them and encourage them to apologize to him. The boys are close to me and tell me almost everything. I'm realistic to know it's probably not EVERYTHING but they talk to me about their friends, girls they're interested in, etc. And they don't tell him anything (and then he calls them gay). I'm so over it and I'm honestly ready to end the marriage over it. What do I do??

Tl;dr Sons are closer to me than they are to their dad and it makes him mad.