Let $r=\frac{p}{q}$, where $p$ and $q$ are integers. We will show that $r$ can be written as the sum of two rational squares if and only if $pq$ can be written as the sum of the squares of two integers.
Equivalently, if $p\ne 0$, then $\frac{p}{q}$ is a sum of the squares of two rationals if and only if every prime divisor of $pq$ of the form $4k+3$ occurs to an even power.
Proof: If $pq$ is the sum of the squares of two integers, it is clear that $r$ is the sum of the squares of two rationals.
For the other direction, suppose that $r$ can be written as the sum of the squares of two rationals. Without loss of generality we may assume that the rationals are $\frac{a}{c}$ and $\frac{b}{c}$ for some integers $a,b,c$. Then
$$\frac{a^2+b^2}{c^2}=\frac{pq}{q^2}.$$
So $c^2pq$ is a sum of two squares. It follows that every prime of the form $4k+3$ occurs to an even degree in the prime power factorization of $c^2pq$, and hence of $pq$. It follows that $pq$ is a sum of two squares.