Its random and no way to be sure, but i believe if u buy a 31 year old player, if he has just 2 years on his contract it means he will retire at 33 while if he has 3 years on his contract then he will retire at 34.... But I am not totally sure of this.