My question is :
Let us assume that we have to find the number of homomorphisms from $S_n \to D_{2n}$ when $n > 3$
How to prove that the elements of the form $xyx^{-1}y^{-1}$ always belong to the kernel.
So all the even number of $2$-cycles can be written in the form $xyx^{-1}y^{-1}$ and they belong to the kernel. [which is what I know as $A_n$ is the only normal subgroup of $ S_n$ except when $n \ne 4$,but I can't use this result as I will have to prove this using sylows theorem which we haven't been taught so can't be used in exam ]
I really like @ancientmathematician's argument above but if you want here's another argument.
Suppose $N$ is the kernel of your homomorphism, then $N$ has index dividing $2n$, so all $2n$th powers are in $N$, in particular, those elements whose order is coprime to $2n$ are in $N$. Now choose odd number $k\leq n$ coprime to $2n$ (the only time you can't do this is when $n=3$ which as the others mentioned is a counterexample, otherwise choose $k=n-1$ or $n-2$ works) then all $k$-cycles by the above are in $N$.
All $k$-cycles for $k$ odd generate $A_n$ so $A_n\subset N$. If you don't yet know this see here or here And it's clear that all commutators are in $A_n$.