Using LEDs to indicate if a toilet is occupied or not?
Motion sensors and a microcontroller.

There are various motion sensor modules available, like this one. You could put one in each toilet and connect them to a microcontroller which does something like this:


Keep checking the motion sensors if there's any movement.
If there's movement in a toilet, assume it's occupied for the next x minutes.


The either use a cable or transmitter/receiver modules to communicate this to the lamp module where you want to show which toilet is occupied.

In some houses, they now have motion sensors in toilets for the light. When you enter, the light turns on and it automatically turns of after some minutes after the last motion. If you have this, you could try to connect this motion sensor to your project. The nice thing about this is that when someone takes his time, the light will turn off (people typically don't move a lot on the toilet), and he will have to trigger the sensor to keep the light turned on. Then the data your microcontroller relies on is also accurate. If you don't have this motion sensor for the light, you could of course decide to implement it yourself.