Therefore, if you spent significant amounts of time outside the U.S. during your six year stay, it is possible to "recapture" some of that time by extending the six year maximum. Please be prepared to provide evidence of significant periods (i.e., more than one month) of time spent outside the U.S. in H-1B status if you want to apply for an extension to get the benefit of time spent outside the U.S.
After the 6-year limit on an H-1B visa is reached, an individual can leave the U.S. for one year and re-enter on an H-1B visa. The one year abroad does not have to be in your home country or country of last residence.