He didn’t tell me had a gf..

So I’m currently heartbroken because this guy I met seemed so perfect and treated me so perfectly, he called me his girlfriend and repeatedly told me he liked me and all that, then I find out he has a girlfriend that doesn’t live in the city we live in and I’m utterly broken. I don’t think he meant to hurt me because he truly does have feelings for me and has constantly apologized and said it was just a very complicated situation. This has never happened to me and I just don’t know what to do. I want him so bad but I know it could never be because there’s history between the two obviously, they’ve been together on and off since middle school. I just don’t understand how someone could be so selfish. Any tips for getting over this