**Hint:**
$$13y=x^2-1=(x-1)(x+1).$$ Since $13$ is a prime, therefore $13$ divides one of $x-1$ or $x+1$. But $\gcd(x+1,x-1) \leq 2$, therefore $13$ can divide exactly one of them at a time. Now proceed further.
**Addendum**
As Robert Israel mentioned in his comments, I hope you are aware of the fact that $y$ has to be a square (because based on your notation $y$ is the number of soldiers in a square formation). So let $y=z^2$, then the proper way to do this problem would be to look for solutions of $$x^2-13z^2=1.$$
This is a Pell's equation.