turn on led if stand 5 sec in front of sensor

If you want to check that something is constant for a period of time you can usually do it very simply like this pseudo code - which is the same as the logic proposed in Reply #1. It may seem upside-down-logic because it updates the time when the person is not present.

if (personNotPresent) {
   lastTimePersonNotPresent  = millis();
}

if (millis() - lastTimePersonNotPresent >= 6000) {
   // person has been present continuously for 6 secs
   // do something
}

...R