HINT: Each edge of $G$ contributes two out-and-back paths of length $2$. Each path of length $2$ that is not out-and-back has a vertex at its midpoint that it enters by one edge and leaves by another; thus, each vertex of degree greater than $1$ and each pair of edges incident at that vertex give rise to two more paths of length $2$, one in each direction.