So he has a girlfriend when it's convenient for him, but he doesn't have a girlfriend when he makes sexual remarks to you. Then after teasing you with sexual remarks, he reminds you that he has a girlfriend.
I'm believing he has no idea what boundaries are and he has no idea how disrespectful he is being toward his "girlfriend".
If you are uncomfortable with the remarks and sexual by-play, tell him to stop. This is not how an honorable young man should act. He should not be flirting with you if he has a girlfriend.