php iis7如何用不同的查询字符串参数重写相同的url?

I don't have experience with IIS7 and php.

http://example.demo.com/demo.php?action=user&userid=xx
http://example.demo.com/demo.php?action=admin&adminid=xx

I want to rewrite this url like below.

http://example.demo.com/demo/user/xx
http://example.demo.com/demo/admin/xx

My problem is that rewrite rules are conflicting because of same url pattern.

 <rule name="demorule1">
                    <match url="^demo/([a-z]+)+/([0-9]+)" />
                    <action type="Rewrite" url="demo.php?action={R:1}&amp;userid={R:2}" />
                </rule>

This works fine for any one either user or admin.How can i rewrite the rules so that it can be worked for both.