Measure the wall according to the length to determine how many lengths of chair rail molding will be needed.
To determine the height of the chair rail, measure the height of the ceiling and divide it by three. The general rule is that the chair rail should be about 1/3 of the way up from the floor (between 32" and 36" for an 8’ ceiling). You can also slide a chair up to the wall and mark where it would hit the wall. Once you've determined the height, use your tape measure and level to make a level line along the whole length of the room. Floors are not always level, so using a level to set your line will ensure that your chair rail will be straight.
At your miter saw, mark the molding for your first piece (Image 1). It's simplest to start with an inside corner (or a door or window frame) and use a square (90-degree angle) cut. Cut one piece of molding for each stretch of wall, remembering to use 45-degree angled cuts for the corners (Image 2).
If a wall is longer then the length of a single piece of molding, two pieces should be mitered together. Use opposite 45-degree cuts at the ends that meet to create the miter (connecting each length of molding with a 45-degree mitered edge will create a cleaner, smoother joint). Make sure you position the seam over a wall stud so that the two ends can be nailed into the wood. In most cases, wall studs are spaced 16 inches on center.
When all your pieces of molding are cut, begin installing them starting with an inside corner (Image 1). Align the bottom of the molding with the level line you marked earlier. Attach the first piece to the wall with wood glue and then secure it to the wall using a pneumatic nailer and 2 1/2" finishing nails (Image 2).
Insert the nails into the high parts of the molding to prevent splitting. As shown in Image 3, the nails should be placed into the molding one above the other. Additionally, the wall or molding might not be perfectly straight, so you may have to maneuver the molding to align it as you go along.
When all of the chair rail molding has been installed, use a nail set to recess the nail heads, and then cover up the nail holes with wood filler. Give the molding a light sanding to smooth the joints and puttied nail holes
Apply a bead of paintable caulk to the edge of the molding where it meets the wall, and fill in any other holes or gaps if needed. To finish the project, apply your choice of paint to the chair rail to give it a clean, finished look.