Help training my dog.

We have a 5 month old black lab who bites and nips while playing. I read in several training guides that if he does that, you should immediately stop playing. When I do this, he jumps on my and starts biting even more. Any advice?