Gallon size means little. I have a 4 gal twin tank that works well for what you are asking. CFM
Cubic feet per min. at 90psi is what matters. Sanders, die grinders eat up a lot of air. You will probably get lots of advice here but the rule of thumb is to buy one with enough capacity for your future needs I need to sell mine and go larger 10-12 cfm at least.
It's sorta like buying a tool box. Buy one large enough for the tools you will have someday, not just that will hold what you have now.