Depends. If the undead were a challenge that needed to be overcome, and by commanding it he overcame that challenge, then yes he would gain XP for the creature. On the other hand, if the challenge was to slay the evil spectre to set free the spirit of K'aglith, then no; the character did not...