Pen them separately? The goats should certainly be penned, especially if they are going after your children. If the goats are penned, the chickens *might* go in there... but if the goats butt them, that would discourage them. If your pen is sound the ducks should not be able to get in quite as easily as a chicken would.
When I raise my goats, I never pet them on the head. I don't allow visitors to pet them on the head. I was told that petting or touching a goat on the horn area makes them think about butting, so you should not touch them there, and it seems to work. I have not had a goat that will butt people, ever. If a goat ever so much as touches me with their head, I reach down and pinch them on the ear, or at least I would if it ever happened on my place... it does not. With children that is going to be tough, especially young children, it's not fair to expect them to be consistent in training. I don't think you can train the goats not to butt; that's why I think a pen would work better.