Egress windows are required in every room used for sleeping purposes (bedrooms) on any floor and in basements with habitable space.
Constructing a New Home
If you are constructing a new home, the code requires that you put an egress window in each bedroom. It also requires an egress window in the basement if habitable rooms will be finished in the basement. If you install a basement bedroom, an egress window is required in each bedroom but you need not provide another egress window if there are other habitable rooms in the basement. The bedroom window(s) suffices for the habitable rooms.
If you have an existing home and you add a sleeping room in an unfinished basement, the code requires that you install an egress window in the sleeping room or rooms. Likewise, if you create habitable space in your basement other than a bedroom and you currently do not have an egress window, the code requires that you install one as part of the installation of the habitable room.