Spray the exterior siding with a garden hose equipped with a spray nozzle. Point the hose downward to avoid getting moisture inside the joints between the boards. Spray away all dust and debris. Wait 24 to 72 hours for the exterior to dry, depending on the weather.
Scrape away all loose and flaking paint with a putty knife and a wire brush. Sand the edges of remaining paint where paint flakes were scraped away using a 120-grit sanding block. Sand these edges smooth, then dust the surface with a dust brush.
Fill all joints and holes in the Hardie planks with caulk using a caulking gun loaded with a tube of exterior caulk. Run beads of caulk in all of the vertical joints where the planks meet with the trim work around doors, windows and wall corners. Run your finger over the caulk beads to smooth them out and press the caulk into the joint. Wait 24 hours for the caulk to dry.
Pour 1/2 gallon of exterior primer paint into a 2-gallon bucket and hang a small paint roller screen from the inner lip of the bucket. Roll a mini roller down into the primer and load its fibers with paint. Roll up and down on the screen to evenly soak the roller. Hold the roller sideways so you can roll the Hardie planks horizontally.
Roll across one plank at a time in back-and-forth motions. Press the roller into the joint between the planks to squish paint into this area. Roll out all roller lines, then go over the same painted area with a paintbrush to even out the paint. Roll and brush until all of the siding has been primed. Wait 24 hours, then apply a finish coat of exterior paint in the same manner.