Scent marking is a natural behavior that dogs use to claim territory and communicate with other dogs. When done outside, leg-lifting is generally not a problem, but even the most well-behaved dog can have a problem controlling the urge to hike his leg in inappropriate places indoors. This causes smelly and sticky stains in your home and can damage furniture, walls and flooring. Addressing your dog's health, hormones and training will put a stop to leg-hiking and marking indoors.
Have your dog examined by a veterinarian to rule out any health problems that could be causing excess urination. You want to be sure it is a behavioral issue and not a medical one.
Have a veterinarian neuter your dog. Dogs lift their legs to claim territories, using urine as a scent marker. A neutered dog has a lower hormonal urge to mark territory and less of a desire to hike his leg.
Provide frequent bathroom breaks for your dog so he can relieve himself outdoors in an appropriate area. If your dog needs to urinate, but you do not let it outside, he may lift his leg indoors.
Clean your dog's favorite leg-hiking spots with an enzyme-based cleaner to remove the scent of urine. Dogs are more likely to re-mark certain areas that smell like urine.
Train your dog not to lift his leg by keeping him leashed to you at all times. If he begins to sniff, circle and hike his leg up, lead him away, say "no mark" firmly and then take him outside to urinate in the appropriate spot. Praise him for going outside.