If you want people to reach your server trough a name like "
www.name.com" then you have to buy/register that domain name.
http://name.com is actually a place that sells domain-names. (
https://en.wikipedia.org/wiki/Domain_name )
Remember all those ads for something called "GoDaddy", they also sells domain names, there are a bunch of places that sells domain names.
After you have bought your domain name you have to register the Public IP of your Pi with the domain so that other people can find your server. This is usually where problems start, if you have internet trough a normal "home" internet connection then your ISP-router will most likely change the public IP-address from time to time and you will have no control over this. And then your domain-name points to nothing ( or even worse, the wrong server ).
Therefore a lot of people that like to run home-servers use "dynamic dns" services like for example:
http://no-ip.com. They can give you access to sub-domain names ( example "name.hopto.org" ) where you don't control the whole name, but then they are also cheaper and sometime even free.
They have services that lets you update your public IP address automatically. Either via a script that runs on the Pi, but I also have seen this feature on wifi routers.
In the end you also have to do port-forwarding in your home-router so that when an incoming request comes to port 80 (http) or 443 (https) it will be redirected to your Pi.