https://www.uscis.gov/working-in-the-united-states/temporary-workers/h-1b-specialty-occupations/faqs-for-individuals-in-h-1b-nonimmigrant-status
Q. Does my time outside of the United States count towards my 6-year maximum in H-1B status?
A. Only time spent in the United States as an H-1B beneficiary counts towards the 6-year maximum. Time spent outside the United States exceeding 24 hours, commonly referred to as “recapture time” or “remainder time,” does not count towards your 6-year limit, and you are eligible to recapture those periods of time. The burden is on your petitioning employer to request and establish eligibility for recapture time. Documentation of time outside of the United States may include passport stamps, Form I-94 Arrival/Departure Records and travel history from U.S. Customs and Border Protection, airline tickets, and boarding passes, along with an accompanying chart indicating dates outside of the United States. Your petitioning employer may include such documentation to establish your eligibility for recapturing time when they submit an H-1B petition on your behalf.
https://www.visapro.com/resources/article/h1b-recapture/
Returning To The U.S. After 10+ Years: The Truth About H-1B Recapture Time
You may still qualify for an H-1B renewal under the H1B cap exemption if you have unused time left, even after 6 or 10 years.
If you were previously approved for H-1B and didn’t use the full 6 years, U.S. immigration law allows you to recapture the unused time. There’s no expiration window on this rule. That means even if your H-1B was approved over 10 or 20 years ago, you may still return on a non-cap H-1B if you have H-1B time left.
Example: A software developer worked in the U.S. from 2007 to January 2010, using only 3 years of their 6-year H-1B limit. In 2025, their new employer can file a non-cap H-1B petition for the remaining 3 years, even after a gap of 14 years.
This is often misunderstood. Many believe that once it’s been 6+ years, the H-1B is no longer valid. That’s incorrect if you were previously in the U.S. in H-1B status and you haven’t used the full 6 years. It’s the usage, not the years passed, that matters.