One approach could be to create one automation with both A and B as trigger (it then responds to A or B), and switching the switch on for 10 minutes as action (switch on → wait for 10 minutes → switch off).
When you then set the automation mode to restart (instead of single) you also tackle C.
Personally I never used this, but Node-RED might be what you are looking for.