Only one Sonoff turned on at the same time

Hi guys, could you please help me setting up the process below?

I will use 2 Sonoff POW 16A to power two different circuits. Both of them are flashed with tasmota.

I need to configure them in such a way that there is no possibility that both of them will be turned on at the same time. The following rules apply:

  • If someone turns on #1, #2 automatically turns off.
  • If someone turns on #2, #1 automatically turns off.
  • If both are turned off, #1 automatically turns on (at least one got to be turned on).
  • In case of a power outage, both of them come back obbeying the last power state.

I want to avoid as much as possible that both circuits become activated at the same time, even if it is for a fraction of time.

I am trying to implement something similar to a “selector switch”.

How would you guys do that?

Thank you!