Apply waterproofing to the exterior of the slab. You can use a roller or sprayer to apply liquid membrane waterproofing, which dries to a rubbery consistency.
Place the foam board flush against the slab, setting the bottom of the board on the footers and extending it to the sill plate. If this is not a new construction, and you don't have access to the footers, go below the frost line, or at least 1 foot below grade.
Use adhesive on the back of the foam board to keep it in place temporarily while you work.
Install concrete fasteners through the top corners of each piece of foamboard, using two fasteners per board. Pre-drill holes through the foamboard and into the concrete slab before installing the fasteners.
Protect the foam board that will be above grade, as well as the first 6 inches that will be below grade, by covering with pressure treated wood, stucco, aluminum flashing or material made for the home's exterior.
Backfill around the foam board. Keep the dirt higher against the foam board, so it slopes away from the house. This prevents water from pooling around the foundation.