How do I use different URLs in a single WordPress installation?

Prior to 4.5 vanilla WordPress (without any extras) could get you close but not all the way. As of WordPress 4.5, they no longer require a plugin to map domains. There is a plugin that can allow separate domains to be used in a single multi-site setup but I do not recall what it is at present. (besides plugin recommendations are outside of the scope of this site.)

You will need to look at a multi-site installation. Then you will need to take care of domain mapping. According to the documentation:

In the network admin dashboard, click on Sites to show the listing of all the subsites, and then click on edit for the subsite you want to map to. In our example, this is subsite1.mynetwork.com.

In the Site Address (URL) field, enter the full URL to the domain name you’re mapping – https://mappeddomain.org – and click save.

There exists the possibility of cookie problems (I’m just quoting the docs now as I have never done this). These can be fixed thusly:

If you get an error about cookies being blocked when you try to log in to your network subsite (or log in fails with no error message), open your wp-config.php file and add this line after the other code you added to create the network:

define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);