German Shepherd mommies

First off.. people rarely come to our home.. I have a 8 month old male puppy who always barks and growls at people when we take him anywhere or sometimes if someone he doesn’t know comes around.. I’ve had people walk past our house and he would take off after them but as soon as I yell his name he runs back.. he also doesn’t trust people and always nudges or backs off a little when they try to pet him but once he gets used to them he’s okay, is this a behavioral thing or the way this breed is? 😩