Explanation:
X element is a metal so its tend to lose the valency electron which are 2 electrons
Y is a non-metal so its tend to gain or share the valency electrons which are 3
So
Y+3e−→Y−3 gain electrons
Y+Y→Y2 each atom share 3 electrons
When X combined with Y
3X+Y2→X3Y2
example:3Mg+N2→Mg3N2
Option D is correct