I would use screws before nails. For squeeks from rubbing between subfloor and the joists, you can run some drywall screws at an angle (like toenailing) from the joist into the floor starting the screw low enough so it doesn't go through the 3/4" subfloor. Do this every few inches in a squeeky area. They make a small head stainless screw for synthetic decking that could be screwed down through the carpet from the top.
If the squeeks are caused by flexing/twisting/bending joists, then you need to apply bridging in between. Either some cross X bridging or just a 2by run perpendicular between the joists to stiffen it up.
If the squeeks are caused by a cracked/broken joist or one with a big knot, then sistering another joist along side would help along with bridging and screws in the subfloor.
Use and inject wood glue in any places where the subfloor touches wood if you can.