The formal steps are as follows: introduce an infinitesimal variation $u(x)\mapsto u(x)+\epsilon(x)$, and compute the variation of the functional to first order in $\epsilon$: $$L[u+\epsilon]=\int_\Omega |\nabla (u+\epsilon)|^2\,dx + \int_\Omega \chi_{\{u+\epsilon > 0\}}\,dx$$ $$=L[u]+\int_\Omega 2(\nabla u)\cdot(\nabla\epsilon) \,dx + \int_{S} \frac{\epsilon}{n\cdot\nabla u}\,dx+{\cal O}(\epsilon^2)$$ $$=L[u]-\int_\Omega \epsilon|\nabla u|^2 \,dx +\int_{S} \epsilon\left(2n\cdot\nabla u + \frac{1}{n\cdot\nabla u}\right)\,dx+{\cal O}(\epsilon^2)$$ Here $S$ is the surface in $\Omega$ on which $u(x)=0$. The variation of $L$ vanishes for arbitrary $\epsilon$ if the integrand of the volume integral $\int_\Omega$ and the integrand of the surface integral $\int_{S}$ each vanish identically, so $$|\nabla u|^2=0\;\;\text{in}\;\;\Omega,$$ $$2(n\cdot\nabla u)^2+1=0\;\;\text{on}\;\;S.$$