Two different Query string redirect to same structure Htaccess

You can't use same format or URI pattern for two rules , you can however change your second URL format to look something like https://example.com/second/latest here second can be any word you want add in the rule's pattern

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^second/([^/]+)/?$ index.php?filter=$1 [QSA,L]

Remember to put this rule at the top or before the existing one.