rejected

I really liked this guy for a long time and we would talk every day but he stopped talking to me for about a year because he started dating another girl. I was pretty devastated but I moved on until he sent me a long apology about how immature and stupid he was for dropping me like that, so we were friends again for a bit and then he stopped talking to me again without explanation. anyways recently I was feeling desperate after being rejected by a different guy and I reached out to him again because I still have feelings and he told me that he used to have feelings for me but he's in another relationship now and can't talk to me. I keep dwelling on him and I feel so desperate and sad. no one has ever even tried to be in a relationship with me. what am I doing wrong? please help...