Gas Water Heaters have faster recover time compared to electric models. Whether you get a gas or electric model may be related more to what type of heater, and energy source, is available now. Most people will replace a gas unit with another gas unit and on new construction, decisions are typically to use natural gas if it's available and electric if it's not.
How big should your water heater tank be? It really depends on your usage needs and timing. Generally speaking with gas water heaters, for 1-3 people, use 40 gallon tanks; for 4-5 people, use 50 gallon tanks; and for 6+ people, use 60-80 gallon tanks. For many people, because of the quicker recovery of gas, they'll use the low end size for gas and the higher end size for electric. But lifestyle, and peak hour usage, is just as much to be considered. If you have 2 adults and 3 children and all 5 are showering in the morning between 6:30am and 7:30am for work and school, you'll use on average 10 gallons of hot water per shower. A 50 gallon tank will be adequate. But if all the children shower at night and the adults in the morning, a 40 gallon tank may be adequate as long as no one is washing clothes or running the dishwasher at the same time. If the peak demand is high, like this, but the other 23 hours/day is low usage, you might also consider a tankless heater.
Water heaters have a First Hour Rating (FHR). Calculate your Peak Hour Demand and closely match it to the First Hour Rating. A 50 gallon gas water heater may have a 76 gallon FHR and a 40 gallons per hour (gph) recovery rate. Compare that to 62 gallon FHR and 21 gph recovery rate on an electric equivalent model.
Sediment can cause a hot spot on a gas water heater and cause the tank to fail prematurely. It is always good to check the Total Dissolved Solids in your water supply and either install a water softener or perhaps a water filter to reduce sediments. You may also want to make sure to flush the tank once per year or two to prolong the tank life.
Preventative maintenance is required to extend the tank life. You wouldn't drive your car 100,000 miles without ever changing the oil. Don't go year after year without flushing your water heater tank and removing the sediment.
If the pilot light goes out, and especially if it goes out multiple times, the thermocouple has probably became dirty or is faulty and needs to be replaced.
The anode rod will be the #1 factor in determining the longevity of your water heater. It will generally last approximately 5 years. You might consider replacing it every 5-6 years. The purpose is to prevent rust in the tank itself by interacting with water molecules.
Here in Indiana, we would recommend flushing the system every year for hard water, or every 2.5 years otherwise. Additionally, check and replace the anode rod every 5-6 years as needed.