Deuteronomy 23:10-13

23:10 If there is someone among you who is impure because of some nocturnal emission, he must leave the camp; he may not reenter it immediately. 23:11 When evening arrives he must wash himself with water and then at sunset he may reenter the camp.

23:12 You are to have a place outside the camp to serve as a latrine. 23:13 You must have a spade among your other equipment and when you relieve yourself outside you must dig a hole with the spade and then turn and cover your excrement.