Hi, thank you for rescuing a dog in need and welcome to the forum.
As for the training part..he lacks socialization and doesn't know how to react and the only thing he knows how to do is to lunge and try to bite because he is scared. He's not trying to protect you. He's trying to protect himself. Can you describe the incident in detail as to how the people almost got bit? Also, with a strong dog that lunges and tries to bite, you must have proper equipment to control him. If it makes you feel safer, get him a muzzle. Then, get a prong collar and watch solid k9 training's videos on youtube on how to fit, use it, introduce it to the dog.
The next step is to teach leash pressure (look all this up on youtube - conversational leash pressure). Use this while you take him out on his walks and socializing. Socializing is not having people give him treats, not having people talk or pet him, not having him go up and greet people, not pulling you around on leash, not going to dog parks, not meeting other dogs on leash. Socializing is utilizing space to expose him to things that scare him and using leash pressure to redirect his focus onto you. While doing socialization, advocate for his personal space. You need to show him you can keep him safe. At the same time, study the dog, know his signs, know his triggers. Typical pre-reactive signs are ears up, staring, tail up, mouth closed. If you redirect him with a quick pop and release on the prong when you see those signs, it will be enough to snap him out of it. Key points are to keep moving in a way the dog has to work to pay attention to where you are, correct early, correct effectively (how much strength you use - this is trial and error - more amped up = the stronger the pop, calmly walking but scanning = a light pop) and utilize your space. Don't crowd yourselves. Be aware of your surroundings.
Utilizing space means if dog is reactive to people, don't walk towards a person jogging towards you. You guide the dog and move away and go away or go around the jogger. Another example, don't command him to sit and stay while people continually move into his space. Instead, have a person stand still and walk around the person using ample space. At first, walk at a safe distance then slowly decrease the size of the space bubble. If he starts getting tense, relieve the stress by walking away from the person. Continue to walk around and then towards then away, towards then away, always reading the dog.
If this seems overwhelming and confusing, then find a trainer that can show you how to use a prong collar and work your dog. A prong collar used incorrectly with bad technique is ineffective and will make things worse.
I want to show you a few clips of the dogs I worked with. They are all the same: scared, nervous, under socialized, under corrected, lacking guidance and a person that can advocate for them.