You should continue to socialize him, but only with people you know well. It's a liability to take an unpredictable dog to a nursing home or to let a child pet it. However, you may want to check in with a trainer. Some dogs are "leash-reactive" only. It's something about being on a leash that makes them reactive. They could be more anxious, or protecting you, or feeling constricted by the leash. I can't tell what it is because I haven't met the dog, but a good trainer might know. Be wary of so-called "positive reinforcement ONLY" trainers. Find a balanced trainer who has an open mind to understand that different dogs need different training. Best of luck to you, but please avoid risky socialization scenarios. He is showing warnings that he could bite, and you should take that seriously while you address the issues with a trainer.