Payoffs of loans are not educational expenses. The expenses would be the things the money was used for like tuition. If you already took education credits last year for those expenses, you cannot use them again to make any part of the 529 distribution nontaxable.