Step one: never, ever allow him to greet other dogs while on leash.
Step two: I personally would stop all playtime with other dogs until this problem is resolved. Instead, do something interactive with him: going to a training class, retrieving a tennis ball, teaching him some tricks, whatever, it doesn't matter as long as it builds his relationship with you. Right now he prefers the company of other dogs, hence the lunging. He needs to learn that his human can be fun too.
Step three: teach him to focus on you, not on other people or dogs. You could do this at home, for example by teaching him the "look at me" command. Start by rewarding him when he looks at your face, then add the verbal command afterwards. Do this until he complies 100% of the time. Then re-train the same command in a different place. Dogs don't generalize: even if he "knows" the command in the kitchen, it doesn't automatically follow that he will "know" it in the back yard. You have to practice in a lot of different places for a command to become fully integrated. And don't use the command in high-stress situations (i.e. on walks and while he is lunging) until you are absolutely sure he will comply. If you don't know how to do this kind of training, a group obedience class at a good training school run by people who compete in rally or obedience will help.
Best of luck, hope you find a solution.