best friend (guy) is acting weird

My best friend for five years has a girlfriend and I decided to give them their space for respect to their relationship, but lately my best friend doesn't like that much. I know that we've been always there for each other since the very first day, but he has been sending me these "I miss you" texts and calls me like twice a day, and complains that we don't see each other much. Months ago he even argued with me saying that I friendzoned him. He tells me that our communication is better, that I care more than she does, that I understand him. But now he has been telling me things that I do better than his gf. Like last week! I went to visit him and when I was about to leave his phone rang and I say "Go on, I'll wait until you're done to say goodbye" and he smiles at me and says "You're amazing, why can't she be like that? She would've just walked out yelling goodbye from the door". Then once I invited him for lunch and he tells me "Is that so hard?" And I go "What?😳" kind of waiting one of his sexual jokes, then he says "My gf has never invited me for lunch, not once in our year of relationship". 
It has got me very confused and feeling a little awkward. Him pointing out things that I do, that he would like for her to do has never happened before and yes, their relationship has been kind of rocky at the moment and I know he's trying to save his relationship, which is what confuses me. That's why for the last two days I've been kind of avoiding him. Any advice? I feel like I'm back in freaking high school 😂