That happened to me too. It's weird. I guess you should just wait for them to break up. For me, they broke up really fast because he did like me, not her. If he does like you, it shouldn't be too long until he stops dating her. :)
you stick by his side as a friend and get to know him more and hang out more as a friend and be there for them in order to develop a relationship in the future and wait until he has broken up with his girlfriend and all feelings are left behind
Say, give me a call when you are no longer attached, I wouldn't want a guy who would show interest in another female if he was still attached to me and I'm sure your girlfriend wouldn't appreciate that much either.