The number of $3×3$ matrices $A$ whose entries are either $0$ or $1$ and for which the system has exactly two distinct solutions.
$$A\begin{bmatrix} x\\ y\\ z \end{bmatrix}=\begin{bmatrix} 1\\ 0\\ 0 \end{bmatrix}$$
$$adj(A)=\begin{bmatrix} C_{11}&C_{21}&C_{31}\\ C_{12}&C_{22}&C_{32}\\ C_{13}&C_{23}&C_{33} \end{bmatrix}$$
$$adj(A)(A)\begin{bmatrix} x\\ y\\ z \end{bmatrix}=adj(A)\begin{bmatrix} 1\\ 0\\ 0 \end{bmatrix}$$
$$\begin{bmatrix} |A|&0&0\\ 0&|A|&0\\ 0&0&|A| \end{bmatrix}\begin{bmatrix} x\\ y\\ z \end{bmatrix}=adj(A)\begin{bmatrix} 1\\ 0\\ 0 \end{bmatrix}$$
Case $1$: $y=x$ and $z\ne x$ and $|A|\ne0$
$$\begin{bmatrix} |A|&0&0\\ 0&|A|&0\\ 0&0&|A| \end{bmatrix}\begin{bmatrix} x\\ x\\ z \end{bmatrix}=\begin{bmatrix} C_{11}&C_{21}&C_{31}\\ C_{12}&C_{22}&C_{32}\\ C_{13}&C_{23}&C_{33} \end{bmatrix}\begin{bmatrix} 1\\ 0\\ 0 \end{bmatrix}$$
$$\begin{bmatrix} |A|&0&0\\ 0&|A|&0\\ 0&0&|A| \end{bmatrix}\begin{bmatrix} x\\ x\\ z \end{bmatrix}=\begin{bmatrix} C_{11}\\ C_{12}\\ C_{13} \end{bmatrix}$$
$$\begin{bmatrix} |A|&0&0\\ 0&|A|&0\\ 0&0&|A| \end{bmatrix}\begin{bmatrix} x\\ x\\ z \end{bmatrix}=\begin{bmatrix} A_{22}A_{33}-A_{23}A_{32}\\ A_{23}A_{31}-A_{21}A_{33}\\ A_{21}A_{32}-A_{22}A_{31} \end{bmatrix}$$
$$A_{22}A_{33}-A_{23}A_{32}=A_{23}A_{31}-A_{21}A_{33}\tag{1}$$ $$A_{21}A_{32}-A_{22}A_{31}\ne A_{22}A_{33}-A_{23}A_{32}\tag{2}$$
Let's see equation $1$ $$A_{21}A_{33}+A_{22}A_{33}-(A_{23}A_{32}+A_{23}A_{31})=0$$
Let's say $A_{21}A_{33}=1$, then we have $$1+A_{22}-A_{23}A_{32}-A_{23}A_{31}=0$$
Let's say $A_{23}=0$, then we have $1+A_{22}=0$, now this is not possible so $A_{23}=1$
$$1+A_{22}-A_{32}-A_{31}=0$$
If $A_{22}=1$, then both $A_{32}$ and $A_{31}$ has to be one
If $A_{22}=0$, then exactly one of $A_{32}$ and $A_{31}$ has to be one
So there are three possible structures for $A_{21}A_{33}=1$
$$\begin{bmatrix} ?&?&?\\ 1&1&1\\ 1&1&1\end{bmatrix},\begin{bmatrix} ?&?&?\\ 1&0&1\\ 1&0&1\end{bmatrix},\begin{bmatrix} ?&?&?\\ 1&0&1\\ 0&1&1\end{bmatrix}$$
But only third structure is valid as first two don't satisfy equation $2$
We also have to ensure that determinant is non-zero, so $$|A|=A_{11}(0-1)-A_{12}(1-0)+A_{13}(1-0)$$ $$|A|=-A_{11}-A_{12}+A_{13}$$
Now here $|A|=0$ only when all $A_{11},A_{12},A_{13}$ are zero or $A_{11}=1,A_{13}=1,A_{12}=0$ or $A_{12}=1,A_{13}=1,A_{11}=0$. So total no of possible matrices are $5$
$$\begin{bmatrix} 0&0&1\\ 1&0&1\\ 0&1&1\end{bmatrix},\begin{bmatrix} 0&1&0\\ 1&0&1\\ 0&1&1\end{bmatrix},\begin{bmatrix} 1&0&0\\ 1&0&1\\ 0&1&1\end{bmatrix},\begin{bmatrix} 1&1&0\\ 1&0&1\\ 0&1&1\end{bmatrix},\begin{bmatrix} 1&1&1\\ 1&0&1\\ 0&1&1\end{bmatrix}$$
Now there can be too many cases because only for $x=y,x\ne z,|A|\ne 0,A_{21}A_{33}=1$ we got $5$ possible matrices. It is getting difficult to calculate in this way.
Any other way which we can think of?