Electrical connection that is "AND NOT" gate
A changeover relay should do the trick, although I have made the following assumptions:


C is allowed to draw power from A.
You have a Neutral/non-earth return path for the coil and B.








simulate this circuit &ndash; Schematic created using CircuitLab


No power from A? No power to C.
Power from B? No power to C.