H1B revoked after job loss, now on H4 visa, Eligibilty for Cap quota for new H1B petition

I was working on H1B visa(valid till 2026) with company X and was impacted by layoff in 2023.

After that I visited my home country and came back to USA on H4 visa.

Employer X has revoked my H1B visa after my termination.

Am I eligible for H1B with out Cap restriction as I was previously on H1B already and has not maxed out my time on H1B visa?

Yes you will be treated cap-exempt till the remainder of H1B 6 year term. If you have an approved I-140 you can be eligible of AC21 extensions beyond 6 years.