As Upper_Case pointed out in the comments, do you have a shared chore schedule? If not, MAKE ONE!
I used to live with 7 other people in a 4 bedroom apartment. I was a foreign student in the US and a bunch of us decided to live together to save money. So, 4 bedrooms - two people per each bedroom, 2 bathrooms - 4 people per each bathroom. NEEDLESS TO SAY, it was not legal. It was not pleasant (albeit fun, it was a pain to organize everything), and it was definitely not clean.
After the first 2 months of living like absolute savages, we decided that this is got to stop. So 3 of us sat down, took 2 big pieces of paper (one of the roommates was a civil engineer, so he got one of those massive papers from his lab), drew out every day of the week and the names of everyone.
It was a beautiful schedule. It was split out for the following chores:
- Buying groceries
- Cleaning the person/group's respective restroom
- Cleaning the person/group's respective bedroom
- Cleaning the kitchen
- Vacuuming the floor
- Taking out the trash (this was an every day schedule and kinda went around, one person each day unless there is big trash like a couch)
- SUNDAYS - MASSIVE DEEP CLEANING with everyone involved. Every single one of us cleaned every single corner of the house. Especially given we all drank every Saturday, so we had MORE clean up than usual. So Sundays were the deep cleaning day.
It takes time to catch on and for everyone to fall in their place and do their respective tasks. After 2 or 3 weeks, we noticed that 4 people with one bathroom were doing an excellent job and the other 4 people were not doing ANYTHING. So we installed a little week leader. The task of the week leader is to go behind everyone every day and make sure they did their task. We were all grown (23 year old) graduate students, so we were not really babying the others. But just keep a watchful eye on the duty person and the leader of the week had the burden of screaming at the person's failure of keeping up with his job.
Now in your case, it is more delicate and less communal. It is more sensitive. It is less people. With all these factors considered, I would find the perfect time to bring up the conversation of housekeeping. I would definitely try my best to make your roommate not feel personally attacked. So start with something along the lines of:
Hey, I came home from class last night and noticed that I had left a lot of my hair in the sink after shaving. I am really sorry. I cleaned it up right after I noticed it, but I felt bad. With classes and everything, we just don't have a proper schedule going on for ourselves and find ourselves hardly doing any cleaning up. What do you say we set a schedule? I need something solid to keep me in line so I will take cleaning up after myself a bigger responsibility than I currently do.
With poop stuck inside the toilet, even though disgusting and unhygienic, you could live with it for a week. But with poop on the floor, you could not live a day with that. That is purely unacceptable. The 8 of us had a similar issue where people shave and left their hair in the sink/floor/bathtub. We had to change the "cleaning out restrooms" chore from weekly to daily. So learn from our fault and when you draw out a schedule, make sure cleaning restrooms is a daily task.
I understand it is disgusting and I understand it is not your poop on the floor, but the only way to not ruin your friendship with your roommate and live in a 4 walled-hell is to suck it up and clean every other day after them. If it would make you feel better about what they put you through, you could maybe leave a bigger mess for them to clean up (Just kidding!).
But on a serious note, Mondays Wednesdays and Fridays - You, Tuesdays Thursdays and Saturdays - Them. Sundays - DEEP CLEANING. Set this out and make sure they follow it.
That answers a question you didn't really ask - How to live with the problem.
Now to the question you actually asked:
What's the best way to approach this conversation without making him feel attacked, but still getting the point across that something needs to change?
You want to tell them that they are leaving something brown-ish on the floor every day. Act innocent. No need to tell them they are pooping on the floor. Tell them there was "something" on the floor. The best time and moment to say this is, when you open the bathroom door and see it being nasty, before stepping in, tell them
Hey "roommate name", you spilled something down here. I think it might be soap or shaving cream or something, I don't know. Could you clean it up? I really need to use the restroom.
This will make them realize that you DO NOT consider poop on the floor as acceptable (to say the least). Any normal human would immediately feel embarrassed about it, even if you "did not know what it was".
Handling their reaction to it:
- If they act embarrassed and start apologizing repeatedly because deep down they know that you know what it was, just tell them nonchalantly, "Not at all it happens some times, you are always very clean. I know it must have been an accident because I usually don't have any complaints with your hygiene". This will reassure them into thinking that you have faith in their cleanliness and make them want to be better.
- If they act angry and get annoyed by you pointing something out that embarrasses them, just tell them "well I am sorry, I just needed to use the restroom and I didn't think you'd be this angry about cleaning up after yourself" and just leave. This will leave them guilty and make them want to better.
- If they say they are busy and won't clean it, just tell them "well I really need to use the restroom and go to class, and I thought you'd be understanding of that and clean up after yourself. But I guess I was wrong" and walk out. Again, guilt.
None of this addresses the fact that they pooped on the floor. You could talk about it a few days after asking them to clean their poop over a beer and just bring this up and ask them if they have any health issues and talk about it in a more relaxed setting. But honestly, I really don't think how that matters to you. If it is a health issue and they are unaware of it, it is their problem. If they are aware of it and they don't want to talk about it, it is not your problem. The chances are, a few days after having a conversation such as this one, they would probably open to you themselves and probably start off along the lines of:
Hey about the other day with something on the floor, I am really sorry about that. I have a medical condition
Then you can decide how to deal with it all. I wouldn't really think about a "proper way to bring that up".
Sorry about the really verbose answer. I hope this helps you.