The best thing you can do to keep those dogs from bouncing from home to home - probably eventually being euthanized because of the high prey drive - is to train them properly. I train dogs to herd and all of these dogs have a high instinct drive that has to be overcome. So, the very first thing I teach is a "leave it" cue. Teach the dog to sit, lay down, and stay. Then start the "leave it" cue. with the dog laying down set a treat a foot or so in front of them and hold your hand over it like you own it. Say LEAVE IT firmly. Gradually remove your hand, always ready to grab the food if the dog goes for it. Never let the dog grab the treat unless you say it's okay. After the dog has left the treat alone for about 15 seconds, reward by giving it to him. Then do 30 seconds, a minute, and so forth. Next have the dog sit, lay down, and stay. Set the treat down, give the leave it cue, and begin to walk away 1 step at a time. Again, don't let them have the treat on their own! Start by walking backwards and positioning the treat far enough away from the dog that you can react if he goes for it without your approval. Once he leaves it while you walk away go further and further away, hide behind a wall, etc. Make it a challenge. I do this in my kitchen which has two exits. By the time the dogs have the trick down I go out one door then walk around to the other.
So...once you have this cue down get a strong collar like a choke or pinch collar. I prefer pinch collars. Take your dog next to the goat pen and practice all of the cues - sit, down, stay, leave it. If your dog ever gets excited or focuses on the goats give a strong jerk on the leash (attached to the pinch collar) and say "leave it, down" until he does it. Once you have this well practiced outside of the pen and the dog doesn't act like he wants to pursue the goat - he acts focused on you - go inside the goat pen. Keep the dog on the leash with that pinch collar! Do all the cue again...sit...down...stay...leave it. Now, start applying the leave it cue to the goats. Walk closer to them with the dog, when he gets excited have him go down and leave it. Your leave it cue is now your "that's not for you to attack" cue. You've taught him not to "attack" his prey (the treat). Now apply it to the goat. This should be done in 15 minute lessons 2-3 times a day. Start from the beginning and work at your dogs learning pace. German shepherds are extremely intelligent and you should be able to progress quickly. Your goal should be to have the dog in the goat pen with you, no leash, and for the dog to listen to the leave it cue no matter what so he never attacks the goats. However, if you're not ever comfortable with that, don't attempt the off leash stage. Just do the rest. You dog will put 2 and 2 together and stop antagonizing the goats. Especially if you can catch him testing the fence and getting excited on the outside of the pen and giving a stern "leave it" once he knows the cue. He will soon understand that the excited prey behavior is what you want him to stop. For me the "leave it" cue is used when the dogs are in the goat pen with me - no leashes - and they begin to try to "herd" the group together and I want them to leave the goats where they are.
All of that aside...other good ideas include a stronger fence, more hot wire lines, containing the dogs, and rehomeing them.