Do this when the puppy stops listening to you
As your puppy gets older, it will also become more confident and independent. This is a positive development in your puppy's personality, even if it can be frustrating at times. Your puppy will become more curious about its surroundings and venture further away from you to discover things on its own.
The puppy's attention shifts
Things that smell good, look funny or make exciting sounds will attract the puppy's attention and if you don't seem to want to go with the puppy to investigate, then it will have to go on its own. The puppy may also look at you with a very quizzical look when you ask it to sit down, for example. "What does that mean?" it may seem to think. Or it may refuse to even lift its nose from the ground when you stand and call it hoarse, wondering why the puppy, who last week was the best at calling you in, is now totally ignoring you.
For the vast majority of puppies, this development begins with daring more on their own from about 12 weeks of age. Some puppies become very poor listeners in the process, for others this period comes instead in conjunction with physical sexual maturation which usually occurs around 7-10 months of age.
This is not the "age of defiance"
It is perfectly normal for the puppy to listen less during these periods and although many call it the "age of defiance", it has nothing to do with defiance. Your puppy is not choosing to disobey you to spite you. Dogs do what pays, has high value or is fun and if you neither reward the puppy for desired behaviors nor engage in the relationship, the puppy will choose everything else over you.
In addition to taking puppy classes, which you may be doing by now, there are very simple things you can do at home to strengthen the relationship with the puppy.
Other things you can do to strengthen your relationship
Tell the puppy when it is doing the right thing. Be happy. Reward with a treat, toy or trick or treat with you. Use your voice and body to show how you feel.
Engage with the puppy when you are out together. Of course, it needs to be left alone to fend for itself, but don't let walks and walks become two individuals pulling in opposite directions without communicating at all, but stop in several places and come up with little activities. It can be as simple as practicing sit and lie down, suddenly diving into the bushes and "finding" some treats in there(which the dog can taste when it comes to see what you are doing), hiding behind a tree or similar and letting the puppy look for you. The puppy will definitely be more inclined to keep an eye on you if you are a bit unpredictable and change direction, if you ignore the paths in the woods and go out into the countryside instead, and if you offer fun activities here and there.
Have rules and be consistent. If your puppy always has to make eye contact and wait for "please" before going out the gate, this will become the norm and after a while it will wait inside if you forget to tell it to go outside. If instead you only request contact before it goes out once in a while, it will be surprised those times and run straight out if you don't stop it.