I live with three other (straight) guys, and I'm in the closet, and due to my own carelessness I've been caught by all three of them on separate occasions.
I try not to masterbate while people are home, but with three others that makes it fairly difficult. One day I was laying on my bed, with my bedroom door open, watching porn on my iPad when I heard one of my roommate's doors open from the front of the house. I stopped just in case he came to talk to me, but my bedroom's at the end of a hall and you can't see my bed unless you're pretty much at the doorway or in my room. Anyway, I'd turned off the porn and was waiting to hear whether he was coming to see me or just go into the kitchen and I heard him enter the hall. I quickly pulled up my pants as much as I could, but my fly and belt were undone and there was no way to make that not seem suspicious while on my bed, so I crouched my legs so that my knees were up and covering the part of me that was uncovered. He came in, stood in the doorway, and preceded to chat with me for a good five minutes before he left, so I'm pretty sure he was nine the wiser otherwise I imagine he would have been eager to leave.
With the other two guys, they haven't caught me watching gay porn, but they have unfortunately stumbled across it in my presence - and again, I must reiterate, only due to my extreme incompetence and idiocy. Once we had invited a female friend of our's over to swap holiday photos of a cruise we's all recently been on together and at this stage of the evening, it was just her, one of my roommates and I. And for some reason I was completely drunk on a weeknight. Anyway, she was scrolling through my photos on my laptop when a screenshot of a gay porn video from PornHub came up. I very rarely watch porn on my laptop since my iPad is far more portable to use, but I have this unfortunate obsession that if I see a porn video that I want to watch later I screenshot it so I don't forget the name (I know it's probably easier to sign up and log in and then just favourite it, but I'm paranoid about doing stuff like that in case I get caught, go figure). God knows how it ended up with my cruise photos, but anyway. So my female friend is so cool that she just keeps scrolling through the photos as if she just seen another one if our holiday snaps, which was great, but my roommate blurts out something like 'Fuck!'. Me, being far too intoxicated to care, ignored it completely as well and started rambling on about the next photo.
The other time, arguably the most embarrassing, was again due to my stupidity of screenshoting gay porn, and also involved me being very drunk. We had our usual group of friends over and I can't remember why but for some reason we had my iPad out, and again, I was showing them photos. I'm usually pretty hesitant when it comes to letting people have access to my iPad for the very reason that I watch all my porn on it and that I'm prone to taking screenshots of said porn, and usually when I know people are coming over I try to ensure it's clean of any such material, but I was, sorry for another again, too drunk to care. Anyway, I must of being showing them a photo I recently took and one of my roommates, too drunk to work the iPad, got out of it and into my camera roll. I didn't notice until he clicked on one of the photos and turned my iPad around to show me, head tilted to the side, eyebrows raised, laughing. It was a photo I must have saved off Tumblr, a shot of a guy pulling down hard on another guys's shaft, his balls tight, and his head protruding out of the guys hand, glistening. The shot was taken from between his legs, and I can't recall if it was black and white or not, but I remember it coming across to me as being rather artful (I doubt tasteful would be the right word).
I honestly don't know what he thought, he did seem rather puzzled by what he had found, but we've never spoken about it. I wouldn't be surprised if he was too drunk to even remember the incident - after all I have had hour long conservations with this guy (when he's been drunk and I've been sober) in which he's repeated himself three or four times, having forgotten what he's already told me, and not remembered a thing in the morning. So who knows? My female friend and my other roommate though, definitely know I'm gay if you couldn't tell from my second story. She often mentions how wonderful it would be to have a gay guy in our friendship group and how she'd be totally okay with it in a general conservation sort of way, obviously in an attempt to coax me out of the closet, but I really don't feel the need to as I'm pretty sure most of my close friends know, bar maybe one or two. My roommate from the second story drunkingly told me on another occasion that he'd told one of our other friends, and then on another occasion that guy's girlfriend was telling everyone when we went to a club that I was gay.
So yeah, I sort of feel like people stumbling on my gay porn is actually what outed me, and I don't really have a problem with it.