My younger Shep was very much like this. The trick, they say (and certainly it has worked for me) is to make you far more appealing and interesting than anything else in the world.
So, what's pooch's weak spot? Treats? A ball? A tug toy?
Whatever it is, take it with you on walks every time - but practice lots in the garden first. If the object of his adoration is treats, make him liver cake and carry that... it smells awful but dogs find it irresistable.
Starting in the garden, get pooch to sit and reward with a treat with loads of fuss too. Ask the DC or DH to pass by - alone, with a ball, making a noice, with if you can borrow one, a pal's easy going dog as stooge, any of these, starting off with the less exciting and distracting options and working up to the really interesting ones. Every time he focuses on you (and treat/ball/toy/whatever he adores most) and not anything else, reward with lots of fuss.
The object of the exercise is to get pooch's attention totally on you, even if he looks around at that really interesting other dog/toy/whatever, for you to be able to immediately re-capture his attention.
It DOES take time and an almighty amount of patience. I found that my GSD was better doing this off lead than on and that he feels less threatened off lead. The terrier who passed by on his own lead yesterday, making an almighty racket and lunging towards Chester would have had my boy pulling at the lead to nose, possibly tell him off and play with, so I kept him off lead and focused on me and a stick (shouldn't play stick really, it can be dangerous, but it did the trick!). To his credit Chester sat watching the stick and me, once looked at and put a paw in the direction of the terrier but was called back into focus immediately with a sharp NO from me and a lot of stick waving, look Chester, what have I got, mad enthusiasm from me.
(Terrier's owner now thinks that I'm a nutter but that I do have a very well behaved German Shepherd!!!).
You have to be consistant and to repeat this approach daily, but it DOES work.