For which $a>0$ does the equation $x^2+y^2+z^2=a$ have a solution in $\mathbb{Q}_2$? We want to check for which $a>0$ we have that the equation $x^2+y^2+z^2=a$ has a solution in $\mathbb{Q}_2$. 
$x^2+y^2+z^2=a$ has a solution in $\mathbb{Q}_2$ for $x \in \mathbb{Z}_2^{\star}, y \in \mathbb{Z}_2$ and $z \in \mathbb{Z}_2$ $\Leftrightarrow a \notin 7+8\mathbb{Z}_2$ 
$$x \in \mathbb{Z}_2^{\star} \Rightarrow x^2 \equiv 1 \pmod 8 \\ y \in \mathbb{Z}_2 \Rightarrow y^2 \equiv 0, 1, 4 \pmod 8 \\ z \in \mathbb{Z}_2 \Rightarrow z^2 \equiv 0, 1, 4 \pmod 8$$ 
So, $$x^2+y^2+z^2 \in \{1,2, 3, 5, 6\}+8 \mathbb{Z}_2$$ 
If we take $(x_2, y_2, z_2) \in \mathbb{Q}_2^3 \setminus \{0\}$ such that $$x_2=\frac{a_m}{2^m}+\frac{a_{m-1}}{2^{m-1}}+\dots +a_0+2a_1+\dots \\ y_2=\frac{\beta_n}{2^n}+\dots \\ z_2=\frac{\gamma_l}{2^l}+\dots $$ 
From $(x_2, y_2, z_2)$ we get $(x, y, z)$ if we multiply with a power of $2$, that means that we multiply $x^2+y^2+z^2$ with a power of $4$. 
$$$$ 
Could you explain to me at the following part: 
"$x^2+y^2+z^2=a$ has a solution in $\mathbb{Q}_2$ for $x \in \mathbb{Z}_2^{\star}, y \in \mathbb{Z}_2$ and $z \in \mathbb{Z}_2$ $\Leftrightarrow a \notin 7+8\mathbb{Z}_2$ " 
it should stand that $x \in \mathbb{Z}_2^{\star}, y \in \mathbb{Z}_2$ and $z \in \mathbb{Z}_2$  ?? 
Also how do we get the following?? 
$$x \in \mathbb{Z}_2^{\star} \Rightarrow x^2 \equiv 1 \pmod 8 \\ y \in \mathbb{Z}_2 \Rightarrow y^2 \equiv 0, 1, 4 \pmod 8 \\ z \in \mathbb{Z}_2 \Rightarrow z^2 \equiv 0, 1, 4 \pmod 8$$  
And why do we work $\pmod 8$ ??
 A: With ordinary integers:
Theorem of Gauss that $x^2 + y^2 + z^2$ integrally represents all positive integers except those 
$$ 4^k (8 n+7).   $$
Meanwhile, if $x^2 + y^2 + z^2 \equiv 0 \pmod 4,$ then $x,y,z$ are all even.
Put these together, we say that $x^2 + y^2 + z^2$ is anisotropic in $\mathbb Q_2.$ It is also anisotropic in the real numbers, as the sum of squares is positive unless all the squares are $0.$
Oh, there are no restrictions that involve any other primes.
Recommend Cassels, Rational Quadratic Forms.
Maybe the best thing i can do for you is paste in Dickson's little list, various example os $Ax^2 + B y^2 + C z^2$ where he tells you exactly what numbers are integrally represented. Note this mild difference: first we see $(1,1,3) \; \; D  $ which means that
$$ x^2 + y^2 + 3 z^2 \neq 9^k (9n+6).  $$
Next we look at  $(1,1,12) \; \; 4n+3,D  $ which adds
$$ x^2 + y^2 + 12 z^2 \neq 4n+3, \; 9^k (9n+6).  $$
This form cannot represent $0$ nontrivially in $\mathbb Q_3,$ simply because, if $x^2 + y^2 + 12 z^2 \equiv 0 \pmod 9,$ then $x,y,z$ are divisible by $3.$ We say the form is anisotropic in $\mathbb Q_3.$ It also cannot be $3 \pmod 4$ because $x^2 + y^2 \neq 3 \pmod 4.$ However, nothing more happens in $\mathbb Q_2.$ We can arrange with ordinary integers that $x^2 + y^2 + 12 z^2$ be divisible by arbitrarily high powers of $2$ while keeping $\gcd(x,y,z) = 1.$ That is, the form is isotropic in $\mathbb Q_2.$

