Nail a wooden stake to each corner post of the fence so the stakes extend above the tops of the posts. The stakes must be nailed with at least two nails so they will not pivot. Do not drive the nails all the way into the stakes. This will permit easier removal after the pickets or planks are installed.
Position the first picket against the rails and first corner post. Raise or lower the picket so its top is at the desired installed height. Mark the stake at the level of the top of the picket. Remove the picket.
Tie the end of the string around the stake at the level of the reference mark. Extend the string to the next corner post. Pull the string taut. Hang a line level on the string and then position the string on the post so the line is level. Wrap the string around the post three or four times and then tie it to the stake. Repeat to tie horizontal reference lines to the remaining corner posts at the same vertical level.
Measure and mark a piece of scrap lumber to the desired width of the spaces between the pickets to make a spacing block. The spacing block may be only a few inches long. Trim the spacing block to the width of the spaces.
Working from left to right, position the first picket against the rails and first corner post. Use a carpenter's level to ensure that the first picket is plumb. Align the top of the picket to the reference line tied to the wooden stakes. Nail the picket to the fence rails. Two evenly spaced nails should attach the picket to each rail in a horizontal line.
Place the spacing block against the top rail. Butt the spacing block against the right edge of the first installed picket. Butt the left edge of the next picket against the right edge of the spacing block. Align the top of the picket to the reference line. Attach the picket to the top rail with one nail. Move the spacing block to the lower rail to position the lower end of the picket. Finish nailing the second picket in place. Continue aligning and attaching the pickets until all of the pickets have been installed. Remove the wooden stakes and line.