Lots of lovin' from you and lots of "daddy time" alone with Dad.
This may be the hardest challenge of your life. It's hard to figure out how to show your love to a child who is bristling toward you, but he does need to know that you love him.
At this age, he has probably forgotten, or is currently forgetting, when his parents were married. This is frightening for him. He needs to know that he has 100% security in both homes.
Be tender toward him, defer to Dad in topics such as bedtime, manners, any form of discipline, etc. Also, have Dad be intentional in teaching him to show you love and respect. Sometimes we start to care about someone simply because we acted like we cared about them. Have Dad take him to the florist to pick out some pretty flowers for you, or take him to pick up something for dinner so you don't have to work that evening... you get the idea. Also, if he makes an unacceptable remark toward you in Dad's earshot, Dad needs to quickly say, "we don't speak to each other that way." Disrespect must not be tolerated. Yoy have no power here. Dad holds the cards.
Boys love their moms. Be careful to never criticize her in front of him. As he grows up some he will learn to appreciate your good and loving qualities.
I know your pain. And now I have an adult stepson who comes to me with his sorrows and joys and lots of hugs.