1. I give a command and he doesn't do it (assuming he knows what I'm asking)
2. How to know when the dog knows a command
research clicker training and train at home with a platform or 2. It may help.
Also some form of reward is used to make sure the dog acts on command. You need to modify the reward or else it becomes boring. The dog knows what it will get so is not motivated. Trick is to keep the dog guessing and use various methods of reward. Tug and ball play is a good way to train as well as food. Depends what the dog likes. It is all about balance. You spend ages teaching a down and when you say sit the dog lies down. It takes time for you to work out a method that works and then you need to modify it and learn what doesn't help you and what does help you.
Also a correction is useful to snap a dog into it.
There are loads of different methods. You can correct a dog quickly while saying sit and he is gonna sit pretty quick next time. You can use corrections to correct a behavior or teach the dog to avoid the corrections by doing what you ask straight away. It is up to the owner or trainer. For me slight negative enforcement saves me getting frustrated as the dog is more obedient.