How to remove a Required Field based on other field value
Try using the #states attribute: a structured array describing the different JavaScript states that can be applied to the element when certain conditions are met. Please read the extensive description of this feature at drupal_process_states()