Sounds like there are some good ones in this thread.
My suggestion is that you keep in mind, and you tell the boy, that these things pass. And every other kid has similar struggles. Every kid. Even the popular kids. No exceptions.
You talk with him about how it was hard for you as a kid. And you got through it. It’s hard for him right now but you will get through it. It gets easier. He needs to understand this so he has hope.
You let him know he already has a best pal. That’s you. That will never change even when it gets easier for him to make friends with kids because he will. And be his pal AND be his dad.