How to write correct add_rewrite_rule in WordPress for more than one taxonomy in one rule?

Changed URL formats to be like:

/services/home-care/COUNTY/TOWN

add_rewrite_rule(
    'services/([^/]*)/([^/]*)/([^/]*)/?',
    'index.php?post_type="ag_location"&ag_primary_inspection_cat=$matches[1]&ag_cities=$matches[3]',
    'top' );


add_rewrite_rule(
    'services/([^/]*)/([^/]*)/?',
    'index.php?post_type="ag_location"&ag_primary_inspection_cat=$matches[1]&ag_county=$matches[2]',
    'top' );


add_rewrite_rule(
    'services/([^/]*)/?',
    'index.php?post_type="ag_location"&ag_primary_inspection_cat=$matches[1]',
    'top' );

Based on this solution

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)