Clear[e,H,X,Y,Comm];

e[i_,j_]:=SparseArray[{{i,j}->1},{3,3}]//Normal;

H=-I e[2,2]+I e[3,3];
X=(e[1,2]+e[1,3])/2;
Y=I (e[1,2]-e[1,3])/2;

Comm[u_,v_]:=u.v-v.u;

{Comm[H,X]==Y,Comm[H,Y]==-X,Comm[X,Y]==0 X}