Keep the batteries in the 30-70% range as much as possible this will make them last as long as possible (same goes for any lithium battery (phone or whatever)).
Good advice.
But to be a a little more specific. Lithium batteries prefer not to be used when the SOC (state of charge) is too low, and they prefer being stored when the state of charge is too high.
It's no problem to use a Li-ion battery at over 70% SOC, and it's no problem to store them at relatively low charge like 30% to 40%. Just be sure they're not too low if you're going to store them for a long time, as it's definitely bad for them to go completely flat in storage.
So just to summarize that. They'll last a little bit longer if you mostly store them (between use) at less than 70% and you mostly use them at greater than 30%. This of course implies that it's best to charge just before usage if possible.
BTW. Since the tools and the chargers protect the tools pretty well these days, if you don't do the above then they'll probably still last pretty well anyway.
