How to add custom rules using add_url_rewrite wordpress function for dynamic query variables

How to add custom rules using add_url_rewrite wordpress function for dynamic query variables