He is a young pup. However, he does have what is called a 'dominant' personality that seems to be coming through. Bascially he's pushing your buttons to see what he can get away with. This is not abnormal, it's just dog behaviour. There are a few things you can do. If you haven't taken him to puppy training and socialisation classes then this would be the best idea. This will make sure that the pup knows you are in charge of the 'pack' not him. It will also show you how to walk him and control him properly.
German Shepherds are a working breed, so they need LOTS of exercise. They are also highly intelligent and need to be stimulated. They like nothing better than to be exercised and worked. You must build this into your daily life. But because he is 4 months this will need to be built up. If you go to classes your trainer will be able to help you with this.
If you can't get to classes for any reason, then the next best thing to do is this. Get a good, recent book to read up on the German Shepherd breed. This will tell you how best to look after the breed and how to sort out any problems. I know books can be expensive so if this is a problem, then look up the German Shepherd breed on the internet - there are many excellent sites. You should also think about getting a dog behaviourist's advice - most of them will visit you at home. Normally a one hour session is enough to sort problems out. I've used behaviourists for two of our rescue dogs who, because they were abused, had pyschological problems. One session was enough to get us on the right track. They can work wonders for you in a very short space of time.
Hope this helps a bit.