Check your Federal, State, and Local firearms laws! Gun laws vary depending on where you live. Some states & cities are much more restrictive with gun laws such as California, New York, New York City, District of Columbia, etc.
Due to firearms being regulated on a State and Local level let's discuss our home State of Ohio.
Brick and mortar stores in Ohio - No special licensing or training is needed in order to purchase most common handguns, rifles, and shotguns (excluding NFA items and Class III weapons.) You simply need to have a clean criminal record, pass the Federal background check, fill out ATF Form 4473 in the gun store (licensed FFL dealer), have an Ohio driver's license, resident of Ohio, and be a US Citizen or US Permanent Resident. Generally the entire process is completed within an hour or less, and you can leave immediately with your firearm after the ATF gives you a thumbs up. Occasionally there are delays up to 5 days (if you have a very common name and you didn't use your social security # on the ATF Form 4473, or you're born in a country that USA doesn't have a great relationship with such as Iran, etc.)
Online stores nationwide - Yes you can buy a gun legally online...but it cannot be shipped directly to you! It must be shipped to a licensed FFL dealer, on your behalf. In most cases the FFL dealer will charge you a transfer fee to receive the firearm and transfer it into your name via the ATF Form 4473.
Example - I'm an Ohioan. I find a brand new gun that I want online...being sold by a Florida FFL dealer. I order it online.
I list myself as the buyer during the online transaction. I then choose a local Ohio FFL dealer as my shipping location (local gun store in Ohio of my choice).
Florida FFL dealer ships my gun to my Ohio FFL dealer.
My Ohio FFL dealer calls me when my gun arrives.
I go to my Ohio FFL dealer's place of business to complete the transaction (step 2A above.)
Warning - Never ever ever purchase a firearm for anyone other than yourself! Straw purchasing is a federal crime that can put you in jail for up to a decade! Also never purchase a firearm that doesn't clearly display a serial number.
Yes you can buy a used gun from a private Seller in your home state, Ohioan to Ohioan...but there are many additional risks and laws that you must consider and know! Buying a new gun from a FFL dealer is your safest and simplest bet.
Legal Disclosure - This page is our opinion and summarization of the gun buying process based on many personal experiences of gun shopping throughout the years. We highly recommend that you visit www.atf.gov, www.ohioattorneygeneral.gov, https://www.fbi.gov/services/cjis/nics and/or contact a local & licensed attorney to verify your local and state of Ohio gun laws (Ohioans) prior to attempting to purchase a firearm. Laws are always subject to change. There are also a lot more to learn with gun laws, such as legality of the gun itself, etc. Do your own legal research first!