How to calculate number of matrices contains 2-zeroes lines

Let me suggest a different strategy. I think it is easier to count the complement of the set of matrices you ask for. Say $I_n$ is the number you are interested in, then I will describe how to count $2^{n^2}-I_n$ which is the number of square $n\times n$ matrices with no consecutive zero lines or consecutive zero columns.

Consider such a matrix. Let $m$ be the number of non-zero lines, and $k$ the number of non-zero columns. By removing the $n-m$ zero lines and the $n-k$ zero columns you obtain a $m\times k$ matrix with no zero line and no zero column. Let $J_{m,k}$ be the number of such matrices. To recover $2^{n^2}-I_n$ from the $J_{m,k}$ it suffices to count the ways to insert the zero lines and columns between the non-zero lines/columns or before the first non-zero line/column or after the last non-zero line/column. We thus have $$ 2^{n^2}-I_n=\sum_{0\leq m,k \leq n} {k+1 \choose n-k} {m+1 \choose n-m} J_{m,k} $$ Of course, there are a number of zero summands as I wrote it, one can be more precise on the bounds of the indices.

Finally it remains to count $J_{m,k}$. This should be a tractable inclusion-exclusion problem as it amounts to the number of family of $m$ elements of $\{0,1\}^k$, considered as vectors in $\mathbb{R}^k$, such that:

1) no vector is the zero vector (i.e. no zero line)

2) not all vectors lie in a common coordinate hyperplane (i.e. no zero column).

Edit: To complete the answer. Using inclusion/exclusion to compute $J_{m,k}$ yields $$ J_{m,k}= \sum_{j=0}^{k} {k \choose j}(-1)^{k-j}(2^j-1)^m $$ hence after rewriting, $$ I_n= 2^{n^2}-\sum_{\frac{n-1}{2}<m,k\leq n}\sum_{0\leq i\leq m}\sum_{0\leq j\leq k} {k+1 \choose n-k}{m+1 \choose n-m}{k \choose j}{m \choose i} (-1)^{k+m-i-j}2^{ij} $$ It is not clear if the expression can be simplified in any way. The first values are $I_3=25$ (which is consistent with the list above), $I_4=1368$, $I_5=249175$, etc. It does not appear in the OEIS.