I would walk them separately, they will both be happier.
If you got him at 5 months, do you know his history?
I would recommend a few one to one classes with a trainer. It’s well worth it, I had to with my rescue terrier, even though I’ve had dogs for ever and thought I knew it all.
They will use their own well trained stooge dogs to assess his behaviour. They will see how close he can get on lead, then you call him to return and be rewarded. Practice ,practice ,practice. Avoid close contact, with other dogs, as it sets him off.
This usually works, esp with youngsters. Load up with special smelly meaty treats, and get eye contact for treating, so that the situation is distracted before barking and pulling begins. My trainer asked me to cut out his breakfast and use the food allowance for training. Hungry doggies want you!
Do loads of training exercises , tricks and recalls.