Below is an example of code that makes the first field not required in the form
<?php
function мой_модуль_form_alter(&$form, &$form_state, $form_id){
$form['field_website']['und'][0]['#required'] = FALSE;
}
?>
$form['test']['und'][0]['value']=test;
But I need to check the content in the second field after sending the form, and if it coincides with the value of "test", then the first field became not required.
if($form['test']['und'][0]['value']=='test'){
$form['field_website']['und'][0]['#required'] = FALSE;
}