A rain garden is built for the water, then for the plants
Most failed rain gardens were planted well and dug badly. The plants are the easy part; the hard part is a basin that holds the right amount of runoff and lets it go within a day or two. This guide follows the method in University of Nebraska-Lincoln Extension's rain garden guide (G1758), because it gives homeowners actual numbers for setbacks, depth and size instead of vague advice to "find a low spot." If you want the background on what a rain garden is and why it matters for stormwater, start at the rain gardens hub; this page is the build.
Before you buy a single plant, know how much water you are dealing with. University of Arkansas Extension estimates runoff by multiplying a roof's footprint in square feet by 0.623 to get gallons. The math behind that factor: one square foot of surface under one inch of rain holds 1/12 of a cubic foot of water, and a cubic foot is about 7.48 gallons, so each square foot sheds about 0.623 gallons per inch of rain. A 1,000 square foot roof sends 623 gallons down its downspouts in a one-inch storm. That is the water your rain garden is catching.
Rain garden siting rules keep water out of the basement
Nebraska Extension sets the setbacks: keep the garden at least 10 feet from the house foundation, at least 25 feet from a septic system (and never on top of it), and 25 feet from a wellhead. The seasonal water table should sit at least 2 feet below the surface, and you should avoid spots directly under trees, where roots and shade fight you. EPA's Soak Up the Rain program adds the step people skip: get accurate information about underground utilities before you dig. Call your utility locate line.
The counterintuitive rule is to avoid places where water already pools. A puddle that sits for days means the soil does not drain, and a rain garden dug there becomes a bog. Pick the flattest suitable ground downhill of the downspout instead. If the best spot is more than 30 feet from the house, Nebraska Extension says to move the water with a swale or a buried pipe.