OK, you have only had the dog for 3 months. Do you know his previous history? Has he been neutered?
We took in a rescue dog just over 3 years ago, when he was about 3 years old. Knew nothing of his history, just that he had been abandoned. There were a few issues at first, where he clearly thought he ranked above the children in the household heirarchy. We did some training and he now knows that he is below not only the children, but also the cats, rabbits and guineapigs!
He will still occasionally show that he is unhappy by curling his lip, but the boys all know now that this is a sign that he is not comfortable with whatever they are doing (he has difficulty with loud noises, which is rather ironic in this house!) and they back off and leave him alone.
I'm not 100% sure he would never hurt them, but you cannot be 100% certain with any dog. My previous dog was the most wonderful dog ever. She was 5 years old when DS1 was born and, having been treated as my substitute baby prior to that, I anticipated huge problems. There was none and she was very protective of the children, but I would still not trust her 100%, because dogs are unpredictable and do not live by or interpret rules the way we do.
I think that, as you are now aware of a potential problem, work on that area very intensely, establish where the dog comes in the pack - things like when you have been out for a walk, always ensure the dog is the last one to come through the door; don't allow the dog upstairs, but make sure he sees the children going up there (alpha dogs get the higher ground because it's drier); when you come into the house, ignore dog until you have made a fuss of the children and then only when he isn't demanding attention; always feed him last and make sure he sees this.
I can understand your worries and I had similar when we got our dog, but, unless you have a dog from a puppy, there are always going to be uncertainties regarding how they will react to certain situations. Even then, no dog is 100% predictable.