Your pup may push and lean on you for a variety of reasons—out of fear, as a sign of dominance or simply as a way to get your attention. By petting or reassuring your dog when he does these things, you could be unknowingly reinforcing these unwanted behaviors. If your pup's pushing or leaning on you have become regular and bothersome occurrences, you can encourage your dog not to do these things using positive training methods.
Turn away from your dog when he leans or pushes on you, until he stops. When he stops for at least a few seconds, turn back to him and praise him, giving him a treat. Pretty soon Fido will realize that by not pushing or leaning on you, he gets rewarded, discouraging him from doing these things.
Say "Too bad" in an assertive but calm voice immediately when Fido tries to push or lean on you, and walk out of the room. You can also bring him to another room or put him into his crate. Give him a "time out" of between 30 and 60 seconds. Bring him back out and try again. If your pup leans or pushes on you again, repeat the procedure until he doesn't perform either of these behaviors.
Teach your dog the "sit" command. Say, "Sit" and bring a treat up and over his nose to compel him to sit down. Once he does, immediately give him the treat. Practice the command for 10 to 15 minutes each day until Fido responds to it consistently. When Fido tries to lean or push on you, step away and command him to "sit." Give him a treat and plenty of praise when he does.
Determine what the triggers are for his attempts to lean or push on you and avoid them. If a trigger is something that scares him, teach him to associate it with something good rather than bad. For example, if Fido leans into you out of fear when you bring him to the park, command him to "sit" and then engage him in a game of fetch with a favorite toy. Pretty soon he'll associate arriving at the park with play and fun, not fear.