If you can detect the power for the A/C and light as simply on or off, then you just need to add two 120VAC relays, one powered from each source. The relay contacts from both relays are wired in parallel to 120VAC and the fan so that when either (or both) relay(s) are on, the fan is on.
If you are trying to respond to the current to the A/C or lamp than that's a little more complicated since you need a current operated relay (which are not common) or a current shunt with detection circuitry.