Best condos restrict rentals

Is such a rule legal?