1. Cause of nail pops in drywall is not allowing wet framing lumber to dry out before installing the drywall. The wood wall stud shrinks leaving a space between the back of the drywall and the stud letting the drywall float. Give your framing some time to dry out if there has been a lot of rain. Open some windows on a hot day to get the air flowing or place a fan in the space for awhile.
2. Inproper installation is the second cause of nail pops. When installing drywall press your opposite hand against the board to make sure it's tight against the stud and then screw the drywall in place with the screw gun. Give it an extra push after screwing to make sure the screw has forced the drywall tightly against the stud.
In the example picture we actually double screw to add a bit of redundancy in case one scew slips up. Care must be taken not to set the scew too deeply and break the drywall paper around the screw. This will cause the sheet to float and as soon as there is any force against it, the screw filler will pop.