All I can add to this is, I never mastered it, if I made the door small enough so that the goats couldn't get in there, the chickens couldn't either.
I also got fed up of the chickens pooping in the water etc., so my solution was to separate them. Life is a whole lot easier now.
Good luck to you.