I've these two rules in my web config file to force https and remove www from url.
<rule name="Remove WWW" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(https?://)?www\.(.+)$" />
</conditions>
<action type="Redirect" url="{C:1}{C:2}" redirectType="Permanent" appendQueryString="false"/>
</rule>
<rule name="Redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{R:1}" redirectType="Found" appendQueryString="false" />
</rule>
Note: I've gone through almost all the questions here on SO and almost all the blogs but no luck yet :(. Some of the SO posts are as;
Proper method to remove www from address using IIS URL Rewrite
URL Rewrite Remove WWW From HTTPS
http://madskristensen.net/post/url-rewrite-and-the-www-subdomain
http://www.serverintellect.com/support/iis/url-rewrite-to-redirect-www-iis7/
http://www.bradymoritz.com/iis7-url-rewrite-remove-www-from-all-urls/
....