You shouldn't punish your dog at all in training. I've made that mistake in the past and with dogs and horses and I'll tell you it's counter productive. Wanting to punish a dog, I believe, is typically aggression caused by frustration at the dog not doing what you want. You feel you have control over the dog, which you do, and you feel like you've put a lot of time into telling your dog what you want, which you may have, so you feel like at this point the dog is being bad on purpose. My personal experience is that you should try to find a good stopping place where you can get your animal to do something correctly and walk away when you get frustrated. Think about it and come back to it later.
Now, for how to train your dog. I'll be up front in saying that training a dog with mostly rewards is harder, but in the long run you'll be happier with the results. Your dog will do the commands because he wants to, or is at least happy to do them because you asked. You can get a dog to behave with punishments, but you'll see that dog avoid and cringe. I spanked my dog exactly twice in her life when she did something very dangerous and she'll still occasionally cringe at me. It's not something I am proud of and with hind site, I see how I should have handled it better to avoid both situations.
If you're not using clicker training, or at least some version of marker training, I suggest you search it on the internet. There are literally thousands of video and articles on it. The basic concept is that you have a device that makes a clicking sound. When the dog does a behavior, you mark/click the behavior to let the dog know that it was what they were doing at that exact instant that you want repeated. This is better than just giving a treat, because by the time you finish saying 'Good boy!' or walking to the dog to give them a treat, they could have done 5 different behaviors. It makes what you're asking much clearer. I recommend you find another person and practice on each other. Try to use each others natural inclinations and all non-verbal cues to try and get a particular behavior. Click and hand them an oreo when they get close to what you want and work them in. This will help you understand how your dog sees it, because while you know what sitting is and have a word associated with it, it's like another language for him.
That's the basic principle, but there are guidelines that will help you progress much more rapidly. A few things I suggest from personal experience is to think ahead to what you want to your dog to do on command. Make a list of all the words you'll use and make sure they're all as short and dissimilar as possible. So, you don't want to say 'sit down' and 'lay down' because they're too similar. just say 'sit' and 'down' or 'lay'. Also, dogs have short attention spans. You'll make much more progress by doing three 5min sessions a day as opposed to a 1-hour session on the weekend. You literally be able to see your dog shut down and go listless the same as we all did in school after a boring day.
You should mix it up as well. Pick a few things to work on and rotate through them so it's not the same boring thing every time. Don't be afraid to capture a random behavior or try to shape something out of nowhere. Some behaviors can only be captured this way, such as bark, which is very hard to get most dogs to do. Teaching 'bark' also allows you to teach 'quiet' which many owners would enjoy.
Lack of distraction is another essential when you start training. Go to a quiet room of your house, not outside, no tv, no other dog or people. You said your dog stares off into the distance. Make sure you're the most interesting thing around. Once he can do a command well in there, then gradually increase the stimulus. If he has trouble doing it with a stimulus, then go back to somewhere quieter till he's better.
You also need to reward very frequently and use jackpot rewards when they do particularly well. If they get frustrated, go to something simple and quite.
Lastly, if your dog has a problem with other dogs sniffing him, keep him away from other dogs. It makes him nervous and dog parks, if that's where your going, are not good ideas. Stupid owners with bad dogs go there just as much as people with well behaved dogs. The puppy training or obedience classes are poor choices for the same reason. You want a dog with a short attention span to focus on you when there are a bunch of new dogs, sights and smells to investigate. It would be better to audit a class to get the lessons and apply them in a friendlier environment. Good luck.