The key properties of xor are the following:
- If we have non-negative integers $a_1,a_2\dots a_n$ and we change exactly one of them then the xor always changes
- If we have non-negative integers $a_1,a_2\dots a_n$ and their xor is not $0$ then we can reduce exactly one of them, so that the xor of all of them is $0$.
Try to prove these two properties.
Having these two properties in mind it is clear that if you start your turn with a position $a_1,a_2\dots a_n$ in which the xor is $0$ you won't be able to win this turn (as the xor won't be $0$ at the end, since it will change).
On the other hand, if you start in a position in which the xor is not $0$, you can make it $0$.
So if I start with a position in which the xor is not $0$ I can always make my opponent start his turn in a non-winning position, and eventually win.
If I start in a position in which the xor is $0$ then I will have to leave my opponent with a winning position.