It is important to explain those long gaps to your potential employer, because they want to know what you were doing during that certain time frame.
They want to know if you weren't wasting your time doing nothing, and if you are trustworthy enough. But if you have personal reasons, like having a loved one in the hospital or health-related problems, they might be sympathetic and understand your situation.
But, they want to know if in the future, you are hired, if they can rely on you and trust you to do tasks without wasting time.
I hope this helps.
May