Yes, you will not use quota within 6 years.
But where does the 6 year count start, I don't know. It could start from the date when your H1B was effective, or the date when you lost your job and H1B becomes invalid.
Of course, you need to be either out of US or in valid status after you lost your job.