I'm so confused...

Every time my bf parents come in town to visit him he begs me to come over and stay while they're there. Then when I'm away while they're there. He's all sweet to me in text telling me how much he misses me and loves me. But then when they leave he is so distant and acts like he doesn't want to be with me. He doesn't want to have sex with me which has been making be feel unwanted and loved. I'm feeling really sad tonight and confused on why he acts like he wants to be with me so much when they're in town but then when they're gone it's like he's telling me to keep my ass at home without saying it. I don't feel the love from him or the connection. Idk what I'm doing I just feel stupid