Leave a long and smooth object in the shower. If after a few weeks you find brown marks on it, your friend is gay.
You should just ask him. Better to get it out in the open either way. Wait for the right moment and word it like this: "Dave, I've been wondering, would you like to have sex with me?" On a serious note though. You really could just approach the subject sensitively. Or if you have any mutual female friends, they'd probably be a good person to ask.
Lock him in a room with me for a few hours. Lock us in with weed and cookies. I'll find out for you >:]