First off, never hit your dog, period. This includes smacking on the nose, whacking with a newspaper, shaking, screaming at, or otherwise trying to physically intimidate your dog using violence. This does not make the dog respect you; instead, it can cause fear based aggression and completely upheave your status claim on your dog.
Also, it is important to note that your dog CANNOT understand that what he did was wrong unless you catch him in the act. If you catch him lifting his leg, tell him "no" in a stern voice and simply take him outside. Once he goes outdoors, praise him and let him know he's done a good deed. A dog's memory is only about 3 seconds long--you cannot punish him after the act or he will not associate the punishment with the act of peeing in the house. If you come home and there's a mess, put him outside and simply clean it up. If you come home and the dog is slinking around with his tail between his legs and his ears flat, it's because he's picking up on your body language and knows that you aren't happy.
If your dog only urinates in one particular area in the house, it could be because of the smells that are in that certain room. Once your dog pottys in a spot, he will continue to use the bathroom there as long as the scent of his urine remains. Even if YOU cannot smell it anymore, the dog still may be able to.
When this happens, everyday cleaners aren't going to cut it for animal urine.
You need to use a cleaner specifically made for dog urine and feces, preferably one that is enzymatic. If you go to any specialty pet store, you will find products there called Natures Miracle, Simple Solution, and PetZyme. All of these are enzymatic stain and odor removers specifically made for cat and dog urine and feces.
Since these products are enzymatic, they are going to interact with the enzymes in the urine that cause the stain and smell, effectively eliminating them.
Since dogs will continue to urinate on anything that already smells of urine, you need to get rid of the scent completely. Use a black light bulb to find the areas on the carpet that have been urinated on (those areas will show up as a bright pink/purple under the light). Completely soak these areas with one of the solutions, including the carpet pad if the urine went down that far. As the solution dries, it will work with the enzymes of the urine to eliminate stain and odor. You may need to do this several times over several days in order to be sure you get all of the scent.
With the scent removed, this will hopefully help deter your dog from urinating in the same areas, but there could be other reasons as to why your dog is marking in the house.
You say your pup is a german shepherd--was he adopted from a rescue group? If so,he could also be relapsing into the state of mind he was in while at the shelter. Typically those dogs don't get to spend a lot of time outdoors, and they learn that it's acceptable using the restroom indoors because of it.
If he isn't neutered by now, I would suggest doing so as soon as you can. Not only are there added health benefits to a neutered dog, but the drop in testosterone will sometimes cut back the urge to mark everything.
BELATED EDIT: I hate scrolling up after posting and reading some of the things the incompetent people say. Just to reiterate, dogs are social creatures. They need to be with their humans and this means in the house.
There are many dangers to leaving your dog outdoors, including but not limited to: other animals getting into your yard, other animals with diseases, fleas/ticks/mosquitos carrying diseases such as heartworm or lyme disease, accidental injury such as stepping in a hole and hurting a foot, accidental strangulation on a tether, heat stroke, electrocution, and hypothermia. Sound like fun?
Also, keep in mind that your dog loses a lot of his socialization skills when kept outdoors away from people. If you want your dog to be able to go on walks with you, interact with people, and be a joyful companion for your child, he needs that interation and socialization with people. /end rant