Lots of women (and some men) take years off to have and raise kids. You might have an ailing parent who required care You might have worked several small, irrelevant 'odd jobs' to live off of while finding yourself on a journey of self-discovery You might have been a ski bum / surf bum.
Having a multi-year gap doesn't look good no matter what, but 'prison' isn't the only reason one might have such a gap :)