By definition, Legendre symbol $(\frac{a}{p})=1$ if $a$ is quadratic residue, -1 otherwise. Primitive root $a$ cannot be quadratic residue because otherwise, you cannot generate the whole mod p with the primitive root $a$. Thus, part (b) of your question follows from this idea.
For part (a),
$(\frac{-2}{p})=(\frac{p-2}{p})$ since $-2 \equiv p-2$ (mod p)
Therefore, you have to find primes p so that there exists $0<x<p$ such that
$x^2 \equiv p-2$ (mod p)
Alternatively, one can use Euler's Criterion:
$a^{(p-1)/2} \equiv (\frac{a}{p})$ (mod p)
Solution: Of course, maybe one can directly solve the equation above. Yet, I would do in the following way:
$(\frac{-2}{p})=(\frac{2}{p})(\frac{-1}{p})= (\frac{2}{p})(−1)^{(p−1)/2}...(1)$
where the first equality comes from the multiplicative property of this operation. The second one is a consequence of Euler's Criterion (you can prove it):
$(\frac{-1}{p})=(−1)^{(p−1)/2}$
Back to the equation:
Case-1: If $p \equiv 3$ (mod 4) and 2 is a primitive root (mod p), then $(1)=1$.
Case-2: If $p \equiv 1$ (mod 4) and 2 is a primitive root (mod p), then $(1)=-1$.
In other cases, you can use the following proposition:
The prime 2 is a quadratic residue modulo an odd prime p
if and only if $p \equiv ±1$ (mod 8). In other words: we have $(\frac{2}{p})=(−1)^{(p^2−1)/8}$.