If $R$ is an integral domain (commutative ring with unity has no zero divisors) then a non constant monic polynomial $p(x)$ is irreducible in R[x] if for some proper ideal $I$, the image of p(x) in $(R/I)[x]$ can't be factored in $(R/I)[x]$.
The above is the theorem that I am trying to understand. If we take $p(x,y)=xy+x+y+1\in Z[x,y]$ then $p(x,y)=(x+1)(y+1)$ but modulo (y) the polynomial (monic) p(x,y) becomes x+1, which is irreducible in $Z[x,y]/(y)$ so doesn't that contradict the theorem?