I had the same thing from my early childhood until mid 20s. I never belonged, I was tolerated most of the time, but not a part of it. If I was around at school and kids made plans, I always asked if I can come too, and that was usually fine. But when they did the calling rounds to invite people, they never called me. I got used to it eventually and did my own thing. I read a lot, I played video games, surfed the net.. I somehow became the therapist in my class. People would come to me to talk to me about their problems, I'd listen and help and encourage, and then they'd go and forget I existed. Same at uni. After my mid 20s I stopped to try and make friends really. I'm too different to belong, I don't do any drugs, I don't party, I don't like to go out late. I am depressed, I go to work, I run out of energy, I go home. If I have anything left, I go to the gym. Not to a bar.
Your friends behavior doesn't say anything about you, it says something about them. About their level of kindness and compassion, about their level of development and egocentricism (I hope that is a word?). But I know it is painful to want to belong and to not be accepted. I cannot tell you how to deal with it, I found growing up very painful and isolating, very lonely and alienating. I'm still the therapist in the group of people I call friends-ish, I'm still depressed. But I found 2 people that reciprocated my feelings and interest. I lost them both by now and I cannot cope. I'm sorry op my story doesn't end on a happier note, this is a forum for suicide after all. If my story had a happy ending, I wouldn't be here.
Take care and be kind to yourself, you deserve it.