Horses can't go up steps, so the easiest way to keep them out is have some steps on your house, I don't know if goats and sheep can climb stairs but they don't come into my homes so maybe it works for them too.
A ranch hand helps with socializing with all the animals, I got the "free services" reward trait, so that helps.
I use the biggest property that came with the new world and it sort of contains all the animals without a fence. Plant plenty of the grass close to the barn and house and the goats don't wander much, they do follow the horses. Chickens are best contained, but the goats really like them so they all keep their socials up.
I have really been enjoying playing the game, I usually build more than I play, but that has changed.