I just went through this and have worked relentlessly and at 5.5 months, it has improved significantly. Basically, at four months old, their eyesight improves and they start realizing things outside of you and the immediate pack exist. Do a search in this forum for reactivity and LAT training and you will find tons of information.
Our dog gets better everyday at it. Start working your pup at a distance from those distractions and slowly work up to getting closer to other dogs keeping your dog focused on you. Always be aware of what your surroundings are and at first just calmly turn around and go the other way if another dog is headed your way. Don't let your dog get to the "end of the leash" in a full lunge to where he starts pulling. Look at him and when you see the head and ears perk up, move away or give the "come" or "leave it" command. What has worked for us recently as we have gotten closer is I just say in a calm voice "oh look at that! A puppy! Leave it" and I just keep moving...no stopping and chatting or sniffing the other dog. As soon as you get past the other dog with no reaction, praise and treat like crazy. If trained correctly, the dog will look at you for a response when you say "look at that".
We found a park with very wide trails and I can see another dog way ahead and there is plenty of room to pass other dogs without getting too close and to give the leave it and look at me command. (You need both of those to commands to be solid before doing this)Our next step is find a more narrow walking path, then Petsmart, then a dog cafe...but that may be months away. Don't push your dog too quickly and definitely no Petsmart right now.
The idea is here is telling the dog, "yeah it's a dog (or a bike, or skateboard or whatever), but were going to keep moving. No big deal!"
So... Teach LAT (look at that), leave it, and always work below threshold slowly getting closer as dog is comfortable and not barking! I hope that helps! I am no expert, but I have seen drastic improvement over the lasts 6 weeks doing these steps! Good luck