I would suggest looking at the tools you plan to purchase for use with the compressor.
Air tools will list what CFM @ X PSI they need to operate.
That is the most important number, to make sure it can supply the air flow your tools need to run.
Beyond that, horsepower and tank size are going to be how much money you are willing to spend.
A larger tank will be able to supply air for longer, higher horsepower will be able to fill a tank faster.
Horsepower typically goes up with tank size otherwise the fill times would get severely long but check the ratios of Power to Size. For example I've seen a 2.5HP 8 gallon and a 2.5HP 10 gallon in the same product line. So in that case, the 8 gallon can fill faster and was actually rated to provide higher CFM.
Inflating tires, pretty much any compressor can do.
Impact Wrench (guessing that is what you mean be Rattle Gun) I've seen call for 3-8 CFM @ 90 PSI depending on drive size, torque rating and manufacturer.
Air Ratchets, I've seen 3-5 CFM @ 90 PSI.
The tools that really eat up your air supply are the ones that you keep on for longer periods of time such as grinders and cut off tools. An impact wrench should do its job with a couple quick pulls of the trigger whereas a grinder you can have on for several minutes at a time when you are working on a piece.