Do you notice that no parents have suggested keeping the dog? It's easy to say "keep the dog" if you're not a parent. But having a child is the ultimate responsibility -- and there's an even greater responsibility to the children of others if you're the source of any danger.
Something is wrong with this dog. Whether he's always been this way, or it's a new development, either his pack mentality took over his domesticity or his brain is broken. It's not his fault, of course.
But you can't fix it, through a vet or training or otherwise. This is the way things are. You must accept them, no matter how painful.
If you keep the dog, can you really keep him, when he's very friendly and loving, away from your own children and their friends, or kids from the neighborhood, for the rest of his life?
I can tell you this, and I can't overstate it: If your dog bites your child or another child again, if it results in a serious injury, your life will be over. If it's your child, you'll never get over the guilt. You may also be subject to criminal prosecution. Can you imagine being in prison for the preventable death of your own child?
If it's another child, you'll lose everything you own and will have to declare bankruptcy to stop the child's family from garnishing your wages for the rest of your life following a lawsuit. Plus almost certain criminal prosecution. I know that if a dog hurt my child and I found out that it had seriously injured a child in the past, I might make it my purpose to destroy that dog owner's life. I'm a very loving and gentle person and would try hard to forgive. But if I lost that battle, I would ensure prison + all their money + whatever else I could think of. I would get revenge for my child, because she can't do so herself.
I'm sorry if I'm sounding harsh, I said above that I
really feel for you and I meant it.

But I need to counter some of the other advice you're getting with something strong enough to get your attention.