There are two requirements governing bathroom exhaust fan installation over the tub or shower stall and they are both issued by the manufacturers of those devices not the building or electrical code (unless there is some exception in your particular jurisdiction).
An exhaust fan must be listed for installations directly above the bathtub and / or shower stall
An exhaust fan installed in such location must be installed on a GFCI protected circuit.
Let me know if you have any additional questions. Just click "comment" below.