Answer
$P=\begin{bmatrix}
0 & 1 \\
1 & 0 \\
\end{bmatrix}$
Work Step by Step
Write the $ij$th entry of $P$ as the probability of transition from the state $i$ to $j$:
$1→1$: $0$
$1→2$: $1$
$2→1$: $1$
$2→2$: $0$
So:
$P=\begin{bmatrix}
0 & 1 \\
1 & 0 \\
\end{bmatrix}$