Bathroom Window and fan

A bathroom window must be openable and have an opening of a minimum of 1 1/2 sq ft. OR there must be an artificial light with an exhaust fan providing a minimum of 50 CFM (cubic feet per minute). IRC 303.3

The bathroom exhaust fan must not terminate in the attic but to the exterior. The exterior must have a pest flap or screen to prevent pests from entering. IRC 1501.3