(A) service performed by a duly ordained, commissioned, or licensed minister of a church in the exercise of his ministry or by a member of a religious order in the exercise of duties required by such order, except that this subparagraph shall not apply to service performed by a member of such an order in the exercise of such duties, if an election of coverage under subsection (r) is in effect with respect to such order, or with respect to the autonomous subdivision thereof to which such member belongs;
(B) service performed in the employ of a church or qualified church-controlled organization if such church or organization has in effect an election under subsection (w), other than service in an unrelated trade or business (within the meaning of section 513(a));