How do you stop a male dog peeing in the house while there is a female dog in the same house?

You can get the male dog neutered, this should stop him from urinating in the house as much as he did.