Look for battery capacity loss. That's about it. You can also ask about or find out on Carfax more or less where the car was driven.
Capacity loss will tell you how much life the battery has. Batteries don't normally work fine for 5 year and then suddenly die. Instead they lose capacity over time. A brand new battery has 100% capacity. If in 3 years it has 85%, then means it's losing, and will likely keep losing, about 5% each year. If it has 70% after 3 years, then it's losing, and will likely keep losing, about 10% each year.
Although 70% capacity (30% loss) is the general rule-of-thumb "end-of-life" for a battery, the real end-of-life depends on your needs. Some people can live with a much lower battery capacity than 70%, depending on the car and their driving needs. For an example, I had a Nissan Leaf that lost about 15% in 5 years. I needed at least 70% battery capacity, so I knew that the car would last me another 5 years before needing a new battery.
The other thing to check out is how much a new or refurbished battery actually costs. It may be much lower than fuel and oil change costs over the same time period. You never know until you check it out.