@WhatsUp has the answer, but I wanted to show just for fun how to systematically derive the other case $(X,Y,P)=(0,\pm 1,4)$. It doesn't answer the question because $P=4$ is not prime, but to those who ask "How can we derive the other solution without some kind of trial and error?" well here it is.
Consider the equation $$(p^2-q^2)^2+(2pq)^2=(p^2+q^2)^2$$
Let $pq=4$ so that $$(p^2-q^2)^2+64=(p^2+q^2)^2$$
Let $p=x^2+y^2$ and $q=x^2-y^2$ so that $p^2-q^2=(2xy)^2$ and $p^2+q^2=2(x^2+y^2)^2$ then $$(2xy)^4+64=4(x^2+y^2)^4$$ or $$(xy)^4+4=\frac 14(x^2+y^2)^4$$
The coefficient is rational, but we want it to be an integer. The requirement is that $x^2+y^2$ is even. So let $x=2s$ and $y=2t$ so it follows $$(4st)^4+4=4(s^2+t^2)^4.$$
Remember the constraint $pq=4$. Since $p=x^2+y^2$ and $q=x^2-y^2$ then it follows $(s^2+t^2)(s^2-t^2)=1$. Since $x$ and $y$ are integers then $s$ and $t$ are integers and so $s^2\pm t^2$ are also integers. Therefore $s^2+t^2=s^2-t^2=1$ or $2s^2=2$ or $s=\pm 1$ and thus $t=0$.
Therefore we derive $(X,Y,P)=(0,\pm 1, 4)$.