Well basically you are pulling the plug off the server, thats why your website is appearing offline. The servers which host websites, are supposed to run 24x7 continuously, so that the website always appear online. If the server goes down, all the websites hosted on it also goes down. This phase is called downtime. Most hosting companies advertise as '99.9% downtime', meaning that their servers are switched on, all the time.
Its not a better idea to host your website on your home computer. Either you get a dedicated servers, especially designed to host websites, which are maintained by hosting companies, or get a free, or paid hosting service. If you are hosting your website on your own home server, then you'll need a high end computer, a high speed, and a high bandwidth internet connection with (so that it can cater to multiple requests made, when anyone types in your website in their browser), and high end cooling system for your computer, because your website will appear only, when your computer is switched on, so you may have to keep it switched on most of the time, unless you don't want your website to appear.