Open IIS Manager and click on your site to check for URL being installed. You an install it through the Web Platform Installer (very useful to have), or just download it from the link above.
Using the Installer, seach for URL Rewrite. You can select it, then click Install.
Once installed, click on your site, then double click URL Rewrite.
Now click Add Rules
Conveniently, this “default” redirect is already there for you to select.
Step back: this dropdown list you will see is related to your site bindings. You might need to go back and make sure you have all your bindings in place. Note that I don’t have HTTPS in here. You could select that, as well if you wanted everything to redirect to https://www.domain.com
Here’s the prompt for selecting the canonical domain name, listed from the site bindings
Now that the rule is added, you want to confirm the rules, so click Edit. You can also rename it by clicking Rename.
Review and scroll down to the bottom. Confirm the Action type is Redirect and the redirect type. For SEO you want this to be a 301, meaning the “real” site lives only at www.domain.com. Make sure to hit apply if you update anything, then click Back to Rules.
Note: see the “Append Query String”? If you have http://domain.com/xyz=1 it will redirect to http://www.domain.com/xyz=1. This should be checked by default and is recommended.