It's a baby. You are expecting a toddler to not take a cookie off a plate at eye level in a room when you are out of it.
And, you are playing with dynamite letting a 4 month puppy run about off lead. He can get run over by a car, he can get mangled by one of the dogs he wants to run up to. He can get hit or kicked by a child. Keep him on-lead if the area is not fenced.
As for outside on a lead, lots of dogs do not need animals and people to put up a ruckus. They get bored and begin barking, nuisance barking. When that doesn't fulfill their need of attention/interest, they might dig, escape, and even chew holes in themselves. Also breeds bred for guarding often guard whatever they are tethered to. So the act of tethering can increase barking/guarding behavior. But I think your pup is a little young for that. More likely he is frustrated that he cannot get to the people/dogs and his barking is a symptom of that.
Go out with your pup, praise him for doing his business, do a short fun game, on a long lead, where you are interacting with him, then bring him inside. Your neighbors will appreciate it, and you will be able to mark good behavior, and correct unwanted behavior effectively and consistently.
Bear Cub, Hepsi-Pepsi
Cujo2, Karma Chameleon
Ramona the Pest, Kojak -- who loves you baby?
Tiny Tinnie, Susie's Uzzi, Kaiah -- The Baby Monster.