The holes which were privvies in castles were called 'Guarderobes' from which we get the word 'wardrobe'. In medieval times, in cities, there would be a '**** collector' who would collect the waste of more fortunate people - it would either be dumped at the local midden or cess pit. The less fortunate just went in the street.
The Romans had communal loos, with running water.
And that's about the extent of my knowledge on this scatalogical subject!
Ravs