This type of behavior is common when a person has a crush on another person or at least is interested in that person for whatever reason. Since this guy is behaving this way towards you, he probably has a crush on you or he is interested in you somehow. Just because someone has a girlfriend or a boyfriend, it doesn't mean that they are completely free from having a crush on anyone else. That's honestly not how it works for some people. You know how you can have multiple crushes at the same time? This is kind of the same situation except this person happens to be closer to one of their crushes (in other words, dating them). Just as long as this guy doesn't make a move while he's still dating someone else, you can simply be flattered by the fact that this guy is somehow interested and move on. You don't want to be THAT girl who gets in between a relationship (for starters it sucks to be girl #2 and it also makes you appear like you don't have good values or morals by wanting to "steal" someone else's boyfriend). I hope this helped.