Real Madrid will have to pay €30m to Juventus if they decide to buy Morata back and he has played half or more than half of Juventus' official matches. If he played between one quarter and one half of the games, they'll have to pay €25m, while less than one quarter of the games would mean a payment of €20m.
Furthermore, Morata's clause to leave Juventus amounts to €80m, meaning that if the Turin club were to sell him to a third party before July 2017, they would have to pay that sum in full to the Madrid club.