A good window installation converts a hole in the wall into an integrated part of all three important barriers that make up a wall assembly: the air, thermal, and water barriers.
Because all windows leak at some point, rough openings need to be designed to handle water entry. The rough sill should be flashed with either a pre-formed manufactured sill pan or a site-built pan.
This detail shows a site-built sill pan installed in a wall sheathed with rigid foam. The outside face of the foam is the wall’s drainage plane.
For more on windows:
Even the best window details can be hard to follow because so much depends on the sequence of installation. Use the GreenBuildingAdvisor window installation series along with these window details: