Unless you are uncomfortable being in the restroom while someone else is having a bowel movement then, by all means, leave and return a few minutes later. It is understood that public restrooms are meant to be used and certain things will, of course, occur from time to time. The only "rules" are the same as those for any public place which, basically, boil down to "Remember you aren't alone." Otherwise, do what you have to do, wash your hands and continue with your day.