Never leave your two year old and puppy alone together. Neither is mature enough to behave properly all the time. I like the idea of having the puppy on a leash when he is around your child--that way it is much easier to control him and distract him if necessary. Usually the first thing to do with a biting puppy is to shove a toy in his mouth (entice him with it) and show him what he SHOULD chew on, instead of saying "no" all the time. If he ignores your attempts to distract him and keeps nipping, all attention stops (positive or negative) and you should unemotionally put him in time out for a very short while so he can calm down. He will soon learn, if you are consistent (in real time--how long it feels to you may seem like forever

) that the wrong kind of play leads to no fun.
Along with the discipline goes lots of fun (and at this age, training too should be part of the fun) and good exercise. How much attention is he getting? His exercise, at this point and until he is about 18 months old, should be free choice--no repetitive stuff like jogging or biking--and even walks should allow him plenty of time to stop and explore his environment when he wants to. Don't push him; let him explore and meet people, dogs, or new things at his own pace. Of course, as he gets more secure, pulling you all over the place will probably become a problem--and that's where you need to learn how to leash train him properly.
A good puppy class trains you as much as the dog. It will teach you how to deal with your current difficulties, and also what behavior he is exhibiting now might develop into a problem later on, along with the different techniques you can use to fix those behaviors early.
It also gives a puppy a chance to be around different kinds of dogs and people in an appropriate controlled environment--a must as you start to socialize him. He should be seeing (in a unpressured introductory fashion) as many different people, dogs (assuming he's had all his puppy shots) and other animals, and environments as possible so he can explore them and learn which things are harmless and what not to be afraid of. That way as a mature adult, he will have the background and judgement to make good decisions about when to alert you to possible dangers, and when to relax and go with the flow.