If the player's transfer status is retiring, he will retire when the season finishes no matter the result of the league. (Clarification required, sold all my retiring players!)
EDIT: You cannot sell retiring players by the way. If you want them out of the squad, you have to terminate their contract.