230V Light switch to control intensity and drive two bulbs
The simplest way is probably to use 220V Latching Relay. At each pulse, those change states and remain in position even if there is no power.

For MCU based, It's difficult to have a small implementation because you will need at least a power supply.
Arduino does have some very small boards though.
The idea is to when the system is switched on, the capacitor starts to charge. If it was off for a long time, the voltage on the capacitor will be 0V, if it was switch quickly two times in a row, the second time, the voltage will be somewhere between 0V and VCC.
Using an MCU, you can check whether this capacitor is 0V or not, if not, the switch was pressed twice.
You may need to adjust R1, R2 and C1 to have the proper timings.



simulate this circuit &ndash; Schematic created using CircuitLab
This would only reliably work only for switching twice.

Another method is to have an MCU with non-volatile memory and an RTC clock that has its own battery. You can then store the state in the NVM and the clock to know the timings.

One more method is to have a large enough input cap (like a super-cap) so that the MCU can run for a few seconds when the power is cut off so that you can count the switches.



simulate this circuit