If you do not know the sex of the animal, use "it". You see a dog in the street and say, "It should be with its owner." You see a horse in a field and say, "What is it doing there?"
If you know the sex of the animal, use "he" or "she". You visit your parents, see their dog who you know is male, and ask, "How old is he now?" You visit your friend who is a farmer, go into the barn, look at his best cow, and say, "She looks very healthy." If you do not know the difference between a cow and a bull, you could say, "It looks healthy."