Good luck with that. Speaking as a person who sounds very much like your son, it’s not something I think you can force him to change. Over time (after he gets some negative feedback from his peers), he’ll improve, but don’t expect it all to change. When I was a kid, I talked non-stop (still do), annoyed people (still do, but not nearly to the extent I used to), was brazenly arrogant about my intelligence (thank goodness I toned this down a LOT over the years, but occasionally it can peek out, but I don’t like it when it does), and I always took a little bit longer to realize that I was boring/annoying/insulting people than I probably should have. It has been frustrating for me, as I am genuinely a friendly, deeply caring person, and it would hurt when the lightbulb would finally go on and I realized that the things I said had either annoyed someone or worse, insulted them or made them feel small by either bragging or relating a story that at first seemed like it would be helpful, but in hindsight made things seem much worse (I did that one recently and felt absolutely awful for a week).
I’m much better at controlling these aspects of my personality than I was when I was a kid, but it still happens occasionally, especially in a situation where I’m genuinely trying to help someone understand something and they suddenly decide they’d rather not know about it, with no interest in learning it. I am just now (I’m 34) starting to recognize this when it’s happening, but it’s a disconnect for me, as when I find out I’m wrong on something, or I’ve misunderstood something, I have an absolute thirst to understand that thing completely.
Anyway, the only things you can do is remind him that these behaviors are socially unacceptable and try to, over time, tone it down. But don’t expect a miracle. Do realize that he very likely truly doesn’t know that what he’s doing is causing other people to feel annoyed/hurt/frustrated, etc.