How did they go to the bathroom before outhouses?

Before outhouses, people would go behind a tree or in the woods. When the weather was bad or late at night they would stay indoors and use a pot.