The first part is true. For pets, if we know their gender, we use he or she to describe them. The second part is nonsense though. We would always, without exception, use 'he' or 'she' if we know the gender of the baby. If the gender of the baby is not known it is likely that we would use the singular 'they' rather than 'it', which is a very impersonal word to use when referring to a human being.