Not sure if there's a better sub for this, but at some point humans (or pre-humans) must have just shat wherever (or however most animals do it), right? So I'm just wondering when/how we transitioned from that.
If there is a subreddits for anthropologists (and I'm sure there is, because there's a subreddit for everything) they might have an easier time answering your question.
Not removing this since we have some Anthropologists who frequent the sub, but I would suggest you X-Post this to /r/AskAnthropology, since I feel that this is a question better suited for there.
From /r/askanthropology :
"I actually think this would be a good question for AskHistorians because this question is going to be largely related to the middle ages, and their waste disposal system since that was the real beginnings of toilets/latrine type things. They'll probably have a good answer for you. "
Any information on this?