Some of these comments 🤦🏼♀️. Don’t listen to a word from people who use the words ‘dominance’, ‘hierarchy’, ‘higher in the pack’, ‘know their place in the pack’, or any other bs regarding dominance theory.
I have owned a dog who hated big men, not slim men, just overweight/muscly. She was a rescue and first displayed the behaviour about 3 weeks in, despite having been seemingly fine around them prior to that. We now know she was likely feeling unsure prior to this and not feeling comfortable enough to display her true character. We kept her and made sure she was away (as in completely fool proof secured and muzzled to be certain) when our bigger male friends were visiting. I won’t lie to you, it was STRESSFUL, we were always on edge and it’s harder work than you’d imagine (ie. people of that description turning up unannounced such as meter readers, workmen, delivery men etc etc etc) and we never felt we could do anything on the spur of the moment, our friends stopped dropping by for a brew/drink etc and we did become known as the family with a nightmare dog. Sadly that behaviour started to show whilst we were out of the house after about 3 months too, so we had to keep her muzzled when outdoors, and could only allow her off lead in the enclosed field we would hire occasionally. I had a constant fear of her escaping the garden or slipping her lead and hurting someone. I think that would have been an even heavier burden if she’d disliked children.
However! She was the most wonderful dog otherwise, and even though when we lost her we felt a sense of relief alongside the awful grief, I am so glad we kept her. I have no regrets about keeping her, and she gave us plenty of love and happy memories which more than made up for the stress she put us through.
You say you don’t think it’s pain, but some things, such as ear pain really hurt them and rather than suggesting your niece/nephew were hurting him, it’s possible he was anticipating that they might and so he was warning them. I cannot stress enough that you should get him to the vet to be checked ASAP. Dogs mask pain so well that it often takes an expert to spot a problem.
I’m sorry this is long, but in all I’d say that it depends on your commitment levels here. If you’re able and willing to consult a vet and a behaviourist and to potentially spend the rest of this dog's life making sure he is completely unable to get to children, then you should absolutely keep him and you’ll likely not regret that decision. If you don’t think you can manage that (and it is a huge amount of work, so no judgement here if you can’t) then rehome with full and frank disclosure.
Very best of luck.