How many months do the goat stay inside their body?

Your question contains an incorrect assumption. Goats do not keep their young inside their bodies until they are born, like some other mammals. Goats, like many other animals, give birth to live young after a period of gestation. The gestation period for goats is approximately 150 days or five months.