Ok so I'm friends with this guy online. We've been talking for a couple weeks/months. I know he has a alot of problems (as most people tend to) and has a hard time dealing with them.
Recently we had a... Fight? Ish? Not really? We didn't really get mad at each other? There was just a lot of confusion and thinking we both hurt each other when we really hadn't, and me getting a bit scared by that, then him feeling guilty for it and just a huge mess.
He ended up sending me this long rant-like thing about about how he feels like a terrible, manipulative person, and sometimes ends up lashing out at people like he did to me (or so he claims. He was just more bitter and salty than usual, and I was just a bit confused by his drastic attitude change). I replied with a message just as long refuting his whole rant, going through each point and recomforting him on certain points, such as how I view him (the way the world and other people see him scares him a lot).
After that he just kind of went "I really don't deserve you..." And we more or less slipped back on the usual tone of our messages, joking and light and cheery.

What exactly does this mean? I've looked it up a few time but I can't find the same scenario. Some people claim it means the person doesn't want you around, but I have a hard time believing it here (and it'd absolutely break my heart, he's become a very good friend of mine).
Others say it's just self esteem issues. Is it that? And if so, how exactly do I help with it? I've tried but I'm nowhere near a professional, it feels like too big a task sometimes. Am I simply looking too deep in it?

Any help, answer to any of my questions, simple insights or observations are more than welcome. I can provide a bit more context of needed. Thank you in advance.