I think storing it at around 50% is a good rule of thumb, you don't want to store it at 100%, and running out to 0% anytime is hard on the cells. One of the best things you can do is take it off your bike and store it inside instead of in the garage, or worse outside in harsh weather and more extreme temperatures. Also try not to run it out to 0%... but hey, sometimes you gotta make it home, you know? I've done that every once in awhile and it doesn't seem that my batteries have suffered for it. Take that with a grain of salt, as an ebike reviewer I rarely keep a bike for over one year so I may just not be able to notice the fallout from how I use them.
You can technically maximize the life of your battery by charging to only 80%, and never depleting past 20%... but in my opinion, it's not worth the effort. I think the gains on battery longevity are marginal at best. Worth considering is how much effort and frustration you have to put in to micro-manage your battery charge level, is it worth it? Not for me, but only you can answer that for yourself