I would not expect my dog to determine children from adults. I would expect myself to determine what situation, person or activity is going to make my dog bark or be uncomfortable and to make adjustments to keep our GSD calm. It may be leaving, putting a distance between us, or seeing if Molly will tolerate it by giving her treats and me talking in a calm voice.
A lot of it depends on what your dog is exposed to.And I think much of it has to do with movement rather than age. Molly sees kids as dangerous aliens( I have no children in my household). They are unpredictable, have quick jerky movements, arms flaying, screaming, little toddlers riding their bicycles into her. When Molly was younger, a senior who walked abnormally slow would alarm her. We recently had a drunk in our neighborhood and she recognized his gait was off from half a block away.
THIS needs to be a sticky.
I'm also tired of the "it ought to know", well, it ought to, perhaps, but then again, there's what's "expected" and what's "reality" and the two may be far apart.
The dog is not a "bad dog" if it barks at kids.
Heck, in our hustle and bustle life that doesn't usually involve kids, we forget to expose our dogs to kids.
I don't expect any my dogs to go up and maul a child on sight, but if my dog isn't comfortable with a child, I'm not going to rush out and euthanize him because "he must have a screw loose".
When Ruger saw my not-quite-3-yr. old granddaughter, he basically ignored her, he didn't come unhinged, or fawn over her, he wasn't aggressive in the least, but he wasn't affectionate either.
More of an..."okay you're there" type attitude and just went about his business. He lives for my youngest daughter, anyway, so it worked out fine.