Some horses will kill any dog that is in their pasture, especually an excited dog chaseing other critters. The dog does not belong in with the goats unless they are raised together. A herding dog is just that, a herder; dogs do not make good sheppards. Walk the dog around the permiter often so it will know where the boundrys are located. Let the goats out into a contained area seperate from their pasture, have the dog and yourself chase them back in, do this often sothe dog will get the idea. And for the dogs safety around horses do not allow it toenter the goat pasture, just chase the goats back until they reenter.