The inside guard presses two buttons to prevent the alarm going off.
If he is knocked out the timer runs out and triggers the alarm.

The guard will sound the alarm if he notices the painting, the
trapdoor to the cellar, or the bedroom door open.