Number of matrices $A \in \{-1,0,1\}^{3 \times 3}$ such that the trace of $A A^{T}$ is $3$ 
The number of $3 \times 3$ matrices $A,$ with entries from the set $\{-1,0,1\}$ such that the sum of the diagonal elements of $AA^{T}$ is $3$, is __ .

What I tried:
Let $\displaystyle A=\begin{pmatrix}
 a& b & c\\ 
 d& e & f \\ 
 g& h & i 
\end{pmatrix}$ and $\displaystyle A^{T}=\begin{pmatrix}
 a& d & g \\ 
 b& e & h \\ 
c & f  & i
\end{pmatrix}$
$$AA^{T}=\begin{pmatrix}
\sum a^2 & .. & ..\\ 
.. & \sum d^2  &.. \\ 
 ..&  ...& \sum g^2 
\end{pmatrix}$$
Given $a^2+b^2+c^2+d^2+e^2+f^2+g^2+h^2+i^2=3$
given $a,b,c,d,e,f,g,h,i\in \{-1,0,1\}$
Out of $ 9 ,$ any three is $1$ and rest all are zero(like $1,1,1,0,0,0,0,0,0$)
$$\binom{9}{3}\cdot \frac{9!}{6!\cdot 3!}=$$
but answer is different. How do I solve it? Help me, please.

You are very close. 
First choose three of the slots out of the $9$ to set the corresponding square, $x^2$ to $1$.  Each each of the location, we have two choices.
Hence $$2^3 \cdot \binom{9}{3}$$
