Someone hasn't house-trained him properly!

Dogs (entire or not) need to be trained not to cock their legs inside anyones house, I've always had boys and none of them would mark in my house or a strangers.
Doesn't help you much now, but you need to treat him as you would a puppy. Make sure he has opportunity to go outside, confine him to a very small area, eg crate, when you can't be watching him and if you catch him in the act let him know it is wrong by interrupting him, you might need to shout, clap your hands, leap from your chair :-) but remember that the aim is not to terrify him! Only to stop him and use a tone of voice that shows you're not impressed.
Have now spotted that hes trying to mount your dog too. I'd use the same method, interrupt and remove him from the room and make sure he can't bother her when you're not around to supervise.
Maybe suggest to your friend that she trains him properly before she leaves him with you again, she might not be aware having never taken him to anyones house before, if she was aware of it it was a bit unfair.
Its also not essential that males stop every two feet on a walk to mark but a surprising number of owners let them do it.