My husband suggested that as I learn new skills, I blog about how I do things. Maybe it will be helpful to someone else. I used to hate nail in boxes, they come with a lip that spaces them sort of right if you are going to have 3/8 in sheet rock. But we're planning on 1/2 inch and boxes that are too shallow are a fire hazard. So, here's my process:
1. Measure and mark the center of your box. I had to adjust due to the framing. This is a closet light that can be a little off center.
2. Measure the spacing of the nails, both horizontal and vertical (see photo).
3. Mark where the nails should go, in my case 4 1/2 in apart and 3/4 in back. (See photo).
4. Start to hammer and make sure you are hitting your marks. Hold the box tight to the board. You may have to check, and if you're off start the other nail (so that your nail doesn't pull back in the bad hole) , then try again.
5. Once both nails are started, use a small level to hold the box straight as you nail. (See photo)
6. And nail till your box is secure. In my example, I should have given myself about 1/4 more space on the left. My hammer head didn't clear. This took some creative (and not recommended) hammer work to get the nail in. But the job is accomplished.