Run an electronic stud finder slightly above the area on the wall where the baseboards will be installed. Mark each wall stud with a pencil. You should be able to see these marks when the baseboards are set in place next to the wall.
Measure the wall and use the measurements to cut the baseboard molding to size on a miter saw.
Have a partner hold the baseboard molding in place next to the wall. Use a pneumatic finish nail gun to attach the baseboard to the wall. Where possible, sink the nails into the wall studs.
Spread a bead of caulk along the space between the wall and the baseboard. Wet your finger and use it to smooth the caulk into the gap. Wait for the caulk to dry per manufacturer directions. Paint as desired.