WordPress filter from custom table is not working properly

First of all, you should never build SQL queries like you do – concatenating SQL with raw variables is insecure and it causes SQL Injection vulnerabilities. You should always prepare all queries.

As for the main part of question… You use AND operator in your query, so it will retrieve only rows, that will satisfy all conditions (so every field has to be like given value, so name has to be like given name and email has to be like given email, and so on).

If you change AND to OR then it will match rows that satisfy any of these conditions.

But if I understand your question correctly, then the user is filling filter form, right? So if I fill only email, then I should get all rows that match given email, and if I fill two fields, then I should get rows that match these two fields.

In such case you have to construct your query dynamically:

$table_name = $wpdb->prefix . "credofy_contact_form";
$sql = "SELECT * FROM $table_name WHERE 1=1 ";
$params = [];
if ( trim($name) ) {
    $sql .= " AND your_name LIKE %s";
    $params[] = $wpdb->esc_like($name);
}
... // same for other fields 
$results = $wpdb->get_results( $wpdb->prepare( $sql, $params ) );