Training and proofing is the answer. Obviously, the dog does not understand, that when you are on a walk with him, "his job!" is to be walking with you. He is not free to do as he pleases.
When you walk, what kind of lead are you using? Use a sturdy lead no more than 6' in length, and have the dog "heel!" A slight correction, and a "Leave it!" should be all you need to reel his brain back into mode.
Have you done formal training with him? If you have, get back to it.

If not, get started.
If you're using a flexi, stop, except for potty in a possibly unfenced yard, or a leisurely walk in an open area. He will have to practice heel, and leave it many, many times to be proofed.
Reasons he may be doing this? Quite possibly
uncertainess, and to some degree fear, rather than agression. He does not know the right thing to do so he has chosen his own path. The wrong one. The other part? He's a teenager! One of the milestones you have to help him thru. He can't do it on his own..you can't be bewildered. You have to work.
He see's a stranger, or squirrel, for that matter. "Oh my! What should I do to make it go away? Bark? Pull? Chase? Hide?" He responds with an action, because he is now, no longer doing his job.
The behavior is self reinforcing! "I bark and act like a crazy man and it goes away." Hmmm... "See? If I bark at the bad man, he leaves. So must be this is what I'm supposed to do."
When you walk, and see a stranger, don't tense. Just very businesslike, "Heel!" "Walk!" or whatever...and
M-O-V-E with purpose and intent, with the dog close by your side.
"But...But??

Shouldn't I be chasing? Scaring? Barking with my hackles up?"
No, sweet boy. WE are walking. Your job is with me.
