Time limit for h1b renewal after h1b petition expiry


I had H1B from Company-A and worked in US from 2013 to 2015 and came back India (Petition Got expired on Dec 2016). Now i am working with Company-B - joined Dec 2016.

Qtn here is :- Is there any hard rule that once the petition is expired (from above example/scenario). He/Candidate should apply H1B again under cap-exempt with in X year (is there any time limit to get the cap-exempt - In my case its been 3 years)?

6 years or up to the left over H1B time(which ever is less)

So, H1B Cap Exempt should be applied with in 6 year (from the Date mother country landed)
in my case, I have landed india on 2015 and i should apply cap exempt on or before 2021? Please correct me if my understanding is correct?