My massive sympathy to him and you. One of the greatest emotional pains I ever felt was when DS was lonely in his teens. I put a lot of effort ( and - crucially- so did he) into helping him overcome it. In case any of this helps, I'll pass it on.
We worked a lot on his social anxiety by getting him to recognise everyone is shy and nervous some of the time and that's okay. I helped him to recognise what overtures of friendship look like and how to respond without coming over as too keen or too offhand. He had been missing some social cues and started picking up on them.
He agreed to focus on just being out and about in the world in lots of different ways. For him, strong friendships grew from unexpected sources. First, he volunteered at a charity which had lots of overseas volunteers who knew no one when they arrived in uk so they all ended up hanging out together. Then he made friends in an online hobby group that started to have real life meet ups.
He got good at music and ended up playing regularly with some other musicians. For your DS, that might be a sport or art class or any other group thing.
He also started online dating - really simply at first, just meeting for a coffee and not hoping it would go further, just to build confidence.
A few years on, he is happy and sociable but he really was deeply lonely and so shy he truly believed he'd never make friends, let alone get a girlfriend. He just made a project of getting out there despite the anxiety, and accepted all social offers however unlikely they seemed.
Your DS might feel that list of things is way too daunting. So did DS. He built up to it over a year or more. And each step was painful and fraught with anxiety and self doubt and lots of stumbles on the way. But he kept trying.