I can only come up with the following:
If there is a nontrivial nilpotent element $r+(X^2-Y^2)$, then
- $r^n\in(X^2-Y^2)$ for some integer $n$;
- and $r\not\in (X^2-Y^2)$
Similarly for a nontrivial idempotent
- $r^n-r\in(X^2-Y^2)$ for some integer $n$;
- and $r\not\in (X^2-Y^2)$
In order to find the factorization of $X^2-Y^2$, which is the very first step as said in the comments, observe that $\mathbb F[X,Y]$ is a UFD, and the polynomials of degree $1$ are irreducible elements.
First case. If $\operatorname{char}\mathbb F\neq 2$, the polynomials $X+Y,X-Y\in \mathbb F[X,Y]$ have degree $1$ and satisfy $(X+Y)(X-Y)=X^2-Y^2$, so this one is the unique factorization of $X^2-Y^2$ in irreducible polynomials.
Nilpotents. If $P\in \mathbb F[X,Y]$ is a polynomial satisfying $P^n\in (X^2-Y^2)$ for some natural number $n$, obviously $P^n\in (X+Y)$: but in a UFD an element is irreducible iff it is prime, hence the ideal $(X+Y)$ is prime and contains $P$. The same arguments show also $P\in (X-Y)$, so finally: $$P\in (X+Y)\cap (X-Y)=((X+Y)(X-Y))=(X^2-Y^2).$$
Idempotents. Let $p\in \mathbb F[X,Y]/(X^2-Y^2)$ be the residue class of $P\in \mathbb F[X,Y]$, and suppose that $p(1-p)=0$. So $P(1-P)\in (X^2-Y^2)$: but if $(X^2-Y^2)$ contains either $P$ or $1-P$, then $p$ is a trivial idempotent; hence assume (without loss of generality) that $P\in (X+Y)$ and $1-P\in (X-Y)$. It follows that $1\in (X+Y,X-Y)$, which is absurd as any polynomial in $(X+Y,X-Y)$ has degree at least 1.
Second case. Assume $\operatorname{char}\mathbb F=2$. Now $X^2-Y^2$ is $X^2+Y^2=(X+Y)^2$, and the latter is the unique factorization.
Nilpotents. The nilradical of $\mathbb F[X,Y]/(X+Y)^2$ is the image in the quotient of the ideal $\sqrt{(X+Y)^2}=(X+Y)$, as $X+Y$ is prime, meaning that the residue class of any polynomial in $(X+Y)$ is nilpotent in $\mathbb F[X,Y]/(X+Y)^2$.
Idempotents. If $P\in \mathbb F[X,Y]$ satisfies $P(1-P)\in (X+Y)^2$, the residue class $p$ of $P$ satisfies $p\neq 0,1$ only if $P,1-P\in (X+Y)$, absurd as $1\notin (X+Y)$.