They recover stamina when not driving, Thats why the endurance races allow upto 4 drivers.
By the time the 4 driver rotation is complete the driver 1 stamina will recover to full.
Driver 1 pits
Driver 2 takes over.
when driver 2 pit stops driver 1 stamina should be 1 third refilled.
Driver 3 pit stops, Driver 1 = 2/3rds of stamina refilled.
Driver 4 pit stops and swaps with driver 1 whos stamina bar is now FULL.
and repeat...
The lemans event is there to catch out users of the Pitting system by using only 3 drivers.You can't use the auto pitting system. you need to rely on the crew chef. drivers in the pit lane will only recover full stamina when it rains.