Playing with rewrite rules in IIS8 and trying to get it to redirect http request to https, I found that if you have the “require SSL” tickbox selected it will not process your https rewrite rules.
For reference here’s the rule which worked perfectly once I disabled the require SSL setting.
Or in an easier to copy format here’s the web.config file
Note: It probably exhibits the same behaviour in IIS7 and earlier, I just never bothered to test those, I was only using IIS8.
Here’s the link to IIS rewrite as well for those interested