Consider this: a positive integer $n$ is a sum of squares (meaning: of two squares of natural numbers) if and only if in its prime-power factorization, primes congruent to $3$ modulo $4$ appear with an even exponent.
Proof
I assume the hard direction is from left to right. So let $p \equiv 3 \pmod{4}$ be a prime, and suppose $p \mid a^{2} + b^{2} = (a + i b) ( a - i b)$. Since $p$ is still a prime in the Gaussian integers, $p$ divides one of the factors. But if $p^{e}$ is the highest power of $p$ that divides $a + i b$, then conjugating we see that $p^{e}$ also divides $a - i b$. It follows that the highest power of $p$ that divides $a + i b$ and $a - i b$ is the same, say $p^{e}$, so the highest power of $p$ that divides $a^{2} + b^{2}$ is $p^{2 e}$.