It's not likely that you are going to change his behaviour in general or with others. But you can still do a lot to keep a conversation on track when you are talking to him yourself.
If you were talking about the bride at a wedding and he starts to go on a tangent or talk about something unrelated, simply pose a short prompt or clarifying question out loud such as ".. so the bride didn't think that the prank was at all funny?" or "what did the bride do next..?".
You should be prepared to gently but persistently and probably frequently nudge him back on topic. The only practical way to do this is going to be with a lot of short interruptions. This may get some pushback at first but unless he gets so upset as to stop talking to you entirely it is likely to succeed.
Try not to be confrontational, actually make a particular effort to be polite and easygoing at first to ease the transition. You'll get less resistance if you don't point out that he is off topic or directly criticize his rambling. Instead just interject a question or comment about the original topic, essentially changing the conversation back to the original topic as unobtrusively as possible. As soon as he goes off track or changes the subject pop a question or encouragement into the conversation that directly relates to the original topic.
Don't wait very long for an opening to do this, if he doesn't pause within a few seconds of going off topic, then talk over him if necessary to nudge the conversation back on track. He may not react well to this at first but (most people) have unplumbed depths for adapting to unexpected situations. If you consistently nudge the conversation back on track he will most likely push back a few times then more or less adjust to your "course corrections".
Try to do this as if it's no big deal, as if you're just interested in his previous statement and asking him to elaborate on that point. You don't want to position yourself as an antagonist or make it seem like you are trying to control the conversation. You can do this, at least at the outset, by letting him do the most of the talking but you make short interjections whenever he strays off topic.
Be prepared to interject fairly often with short questions or phrases that point back to his original thoughts when he strays. I've seen this work really well in the past. People can develop situational habits, that is stay more on topic with you than he may with other people. If you're lucky the nudging will also help develop his own ability to stay more on topic but there is no guarantee of that.
You may have to frequently nudge the topic back on course with short comments on the original topic but it's worth doing to have a more coherent and sensible conversation with him.