Naturally horses will feel safety in numbers, so he will be more drawn to the other horses since his instinct tells him to stick by them and worry when they leave. Your job is to persuade him to ignore his instinct. It's not him being bad or naughty - he's simply just being a horse. We just need to make the wrong thing hard and the right thing easy so he learns to see other horses as work and being on his own and away from them as relaxing.
Fighting with your horse will simply add stress to the situation and will naturally make him want to be with the other horses more. At the end of the day, why would he want to stand with you when he fears your crop, or a yank, or shouting? I'm not saying you do any of these things, but I've seen people doing it all to often and they wonder why their horses would much rather be elsewhere.
Begin in an enclosed space; a small arena will do. Have one other rider in the arena with you on their (preferably quiet and well broken) horse, going around in walk. Allow your horse to go near the other horse, even let him canter up to it if he wants to. Allow him to make the mistake of putting himself into work - do NOT hold him back!
Once near to or next to the other horse, make him perform tight circles around or near it and make him work hard for one or two minutes at a time. After working him near the horse, direct him away from the horse and allow him to rest, but only when he is as far away from his equine friend as possible.
Do the same again, by allowing him to approach the other horse and then make him work for it. This is your way of telling him "Yes, you can be with your horse buddy, but it's hard work!" The work doesn't always have to be tight circles; it could be asking for canter only when he's nearby/next to the other horse so he begins to relate his equine friend with work rather than relaxing.
Consistency is your best friend here. Repeat continuously until he no longer insists on going up to the other horse. He will learn to relate other horses to work (the hard option) and will relate to being away from horses with relaxing (the easy option.) This method has worked perfectly with my mare. Remember, horses will always want the easiest option. Allow him to put himself into work, do not fight him back, and show him that being away from the other horses is the easiest, most effortless option.
This is a bit of an out there idea, but it might be worth boarding him in a busy riding school where horses are passing him regularly. That way he associates horses moving past him with standing still (in a stable).
Otherwise, it's just a long road of doing the opposite of what he wants to do until he gets used to other horses, or distracting him. If he wants to turn around and follow, then he has to turn the other way. Be firm but fair. Don't let him get away with being silly but reward when he's not (by treats or by loosening your grip etc). Do not allow bad manners. They are simply out of the question. Walking over you earns a slap, standing still earns a release of reins/rope. Barging off means being turned on a tight circle, walking quietly means a longer contact.
Work on your stop/stand in hand on the ground without other horses. Take a schooling whip with you. Use a preparatory words (such as "and") to let the horse know something is happening, then give the command (such as "walk on" or "trot on" or"woah"). If he doesn't walk on when told, a small smack behind you does no harm then loosening the contact when he does walk. If he doesn't stop when told, back him up to where you gave the command and then release the contact. If he doesn't stop at all and you're hauling on the reins to get him to stop, or if he walks off as soon as you release the contact, a small smack on his knees. The aim is to get him listening to your voice and aids, and focusing on you. Just don't become predictable or he'll stop paying attention, use the whole arena and both reins, and circles and serpentines, and vary the strides between commands. Eventually you won't need to use the stick, you should see him preparing to walk or stop or trot at the word "and". When this happens (and it may take weeks) and you're happy enough with the level of response, try bringing in other horses to the arena while you do it. Get him to focus on your exercise. You may find you have to go back to using the stick to get him to walk on again, or to stop. You may even find you have the become even more sporadic with gait changes to get him to focus. When he gets used to it with other horses, try doing the same thing but ridden (but use in hand first at the start of each session).
The use of a whip is fine if used correctly and accurately.
You also have to focus on yourself. By ignoring the other horses and staying relaxed, you're teaching the horse that it's okay. If you're stressed and worried about other horses, you're teaching your horse that it's something to be stressed and worried about. Getting angry with the horse will also cause him to get more worked up so stay nice and calm at all times. Take deep, deliberate breaths if you find yourself getting frustrated with him.
Take for example a pony I ride. Quite an anxious pony, highly sprung with lots of blood. Likewise, he gets very attached to other horses... or just about anything that breathes... Although he doesn't bolt, he does go upwards, backwards and sidewards very quickly when frightened. If there's something he's worrying about (such as a gate, or sheep), I look at the problem, acknowledge its existence, then look back at where we are going without tensing or otherwise reacting. Once he realizes I'm happy enough with the situation, he calms down.
He’s stabled and goes out with
Is he stabled in a quiet yard, or a busy yard?