This subchapter shall not apply to an employer with respect to the employment of aliens outside any State, or to a religious corporation, association, educational institution, or society with respect to the employment of individuals of a particular religion to perform work connected with the carrying on by such corporation, association, educational institution, or society of its activities.
It shall not be unlawful under section 2000e–2 or 2000e–3 of this title for an employer (or a corporation controlled by an employer), labor organization, employment agency, or joint labor-management committee controlling apprenticeship or other training or retraining (including on-the-job training programs) to take any action otherwise prohibited by such section, with respect to an employee in a workplace in a foreign country if compliance with such section would cause such employer (or such corporation), such organization, such agency, or such committee to violate the law of the foreign country in which such workplace is located.