I am not qualified enough to totally help you, but from our personal experience, you might have to keep him away from all dogs on walks, and work to keep his focus on you. If you see dogs approaching, turn and walk away before he starts reacting. Or if possible, stay at a place where he can see dogs walking by at a distance, but won't react (pull, bark, lunge) and reward him with yummy treats. Then walk him a couple of steps closer to the dog, walk back, calling him away and reward for following you. You can reduce the distance over time.
You could also make sure he is hungry during his walks, so he is more food motivated.
At home, can you keep him on leash and the moment he misbehaves, put him in his crate or playpen for a timeout? Pretty soon he will understand that this behaviour is unacceptable to you. When he does behave well, or is calm around the other dog, you can reward him with treats, praise, attention and play.