Does he do the behavior after he has been upset about something? what triggers it have you noticed any pattern, I guess speaking to him firmly telling him it is not allowed and making him wash the floor and carpet, perhaps taking some privillege away that he likes. If you think there could be a medical problem definatly speak to your Doctor .Good Luck
You probably should have him see a doctor first just in case there is an underlying medical issue - it never hurts to be sure. If it's not, then he is most likely doing it for attention, so someone needs to find out what's going on in his life - at school or wherever he's spending time outside of the home. (You didn't say if he'd just started peeing in his bedroom or if this has been a problem for some time.) You can do this by getting into a relaxed environment where he can talk openly with you and not feel embarrassed about the topic. If he's just doing it in his bedroom, it sounds like there's some sort of stressful situation going on that only you can help him with.