Problem with custom duplicate check

I currently have the following code: 

<?php

$dictionary['Lead']['duplicate_check']['FilterDuplicateCheck']['filter_template'] = array(
array(
'$or' => array(
  array(
   '$and' => array(
      array('sasa_primernombre_c' => array('$equals' => '$sasa_primernombre_c')),
      array('sasa_segundonombre_c' => array('$equals' => '$sasa_segundonombre_c')),
      array('sasa_primerapellido_c' => array('$equals' => '$sasa_primerapellido_c')),
      array('sasa_segundoapellido_c' => array('$equals' => '$sasa_segundoapellido_c')),
    )
  ),
array(
 '$and' => array(
     array('sasa_primernombre_c' => array('$not_equals' => '$sasa_primernombre_c')),
     array('sasa_segundonombre_c' => array('$not_equals' => '$sasa_segundonombre_c')),
     array('sasa_primerapellido_c' => array('$equals' => '$sasa_primerapellido_c')),
     array('sasa_segundoapellido_c' => array('$equals' => '$sasa_segundoapellido_c')),
    )
   ),
)

),
'ranking_fields' => array(
array('in_field_name' => 'sasa_primerapellido_c', 'dupe_field_name' => 'sasa_primerapellido_c'),
array('in_field_name' => 'sasa_primernombre_c', 'dupe_field_name' => 'sasa_primernombre_c'),
array('in_field_name' => 'sasa_segundonombre_c', 'dupe_field_name' => 'sasa_segundonombre_c'),
array('in_field_name' => 'sasa_segundoapellido_c', 'dupe_field_name' => 'sasa_segundoapellido_c'),
)
);

?>

I'm trying to do is to check if the values in the fields "sasa_firstname_c", "sasa_secondname_c", "sasa_firstname_c", "sasa_secondname_c" match exactly, and show me the duplicates with those 4 fields.
Otherwise I only check exactly the values in the fields "sasa_firstname_c" and "sasa_secondsurname_c".

The real problem is that only the second validation recognizes me, that matches exactly the values in the fields "sasa_firstname_c" and "sasa_secondname_c".

I would appreciate your help or comments in this regard.