Just elaborating on the very nice comments and answer by Cherng-tiao Perng. As Noam Elkies said, $$
\mathbb{Q}[i,\sqrt{-2}]=\mathbb{Q}[\exp(2\pi i/8)].
$$
As is well known, the Galois group of the $8$-th cyclotomic field over $\mathbb{Q}$ is isomorphic to $(\mathbb{Z}/8\mathbb{Z})^{*}=\{1,3,5,7\}$. Let $\sigma_j$ be the element in $Gal(\mathbb{Q}[\exp(2\pi i/8)]/\mathbb{Q})$ that sends $\exp(2\pi i/8)$ to $\exp(2\pi ij/8)$, $j\in \{1,3,5,7\}$.

As is well known, $\sigma_5$ fixes $i$, sends $\sqrt{2}$ to $-\sqrt{2}$, $\sqrt{-2}$ to $-\sqrt{-2}$.
$\sigma_3$ fixes $\sqrt{-2}$, sends $i$ to $-i$, $\sqrt{2}$ to $-\sqrt{2}$.
$\sigma_7$ fixes $\sqrt{2}$, sends $i$ to $-i$, $\sqrt{-2}$ to $-\sqrt{-2}$.

Let $x=a+ib$, $y=c-id$.
If $\mathfrak{p}\in\mathbb{Z}[i]$ may be written as
$$
\mathfrak{p}=x^2+2y^2=(x+y\sqrt{-2})(x-y\sqrt{-2})=(a+ib+\sqrt{-2}c+\sqrt{2}d)(a+ib-\sqrt{-2}c-\sqrt{2}d),
$$
then $$\mathfrak{p}=(a+ib+\sqrt{-2}c+\sqrt{2}d)\sigma_5((a+ib+\sqrt{-2}c+\sqrt{2}d)).$$

Since the primes $\mathfrak{p}$ in $\mathbb{Z}[i]$ are rational primes $p=3,7\bmod 8$ or primes with norms that are rational primes $p=1,5\bmod 8$, we consider these cases.

Suppose $p=1,5\bmod 8$ so that $p=\mathfrak{p}\mathfrak{\bar{p}}$. Since $\mathfrak{\bar{p}}=\sigma_3(\mathfrak{p})$, then if
$$
\mathfrak{p}=(a+ib+\sqrt{-2}c+\sqrt{2}d)\sigma_5((a+ib+\sqrt{-2}c+\sqrt{2}d)),
$$
then
$$
\mathfrak{\bar{p}}=\sigma_3((a+ib+\sqrt{-2}c+\sqrt{2}d))\sigma_7((a+ib+\sqrt{-2}c+\sqrt{2}d))
$$
and
$$
p=\prod_{j\in\{1,3,5,7\}}\sigma_j((a+ib+\sqrt{-2}c+\sqrt{2}d)).
$$
As is well known, for odd primes $p$, this only happens if $p=1\bmod 8$.

As $\{a_0+a_1i+a_2\sqrt{2}+a_3\sqrt{-2}| a_0,a_1,a_2,a_3\in\mathbb{Z}\}$ is a subring of $\mathbb{Z}[\exp(2\pi i/8)]$, i.e.,
$$
a_0+a_1i+a_2\sqrt{2}+a_3\sqrt{-2}=a_0+a_1i+(a_2+a_3)\exp(2\pi i/8)+(a_3-a_2)\exp(2\pi i3/8),
$$
as is pointed out in the other answer, we have to also check, when $p=1\bmod 8$ with $p=\mathfrak{p}\mathfrak{\bar{p}}$, where $\mathfrak{p}$ is an element and not an ideal, which of $\mathfrak{p}^{\prime}\in\mathfrak{p}\{1,-1,i,-i\}$ may be written as
$$
\mathfrak{p}^{\prime}=\prod_{j\in\{1,5\}}\sigma_j(a_0+a_1i+a_2\sqrt{2}+a_3\sqrt{-2}),
$$
and as the other answer indicates, and we may verify, for example, using PARI/GP

rnfisnorm(rnfisnorminit(y^2+1,x^2-2,1+4*y))

[Mod(Mod(-1, y^2 + 1)*x + Mod(y + 2, y^2 + 1), x^2 - 2), 1]

rnfisnorm(rnfisnorminit(y^2+1,x^2-2),y*(1+4*y))

[Mod(Mod(11/2*y - 3/2, y^2 + 1)*x + Mod(8*y - 2, y^2 + 1), x^2 - 2), 1]

and also prove using congruences, that for such situations it only happens when $\mathfrak{p}^{\prime}$ is of the form $a+ib$, $a,b\in\mathbb{Z}$, $a$ odd, $b=0\bmod 4$.

Suppose that $p=3\bmod 8$. Then there are $x,y\in\mathbb{Z}$ so that
$$
p=x^2+2y^2.
$$

Suppose that $p=7\bmod 8$. Then there is $x\in\mathbb{Z}$, $y\in i\mathbb{Z}$ so that
$$
p=x^2+2y^2.
$$