H1B CAP Exemption Applicable or Not

Initial petition validity from 10/01/2011 till 06/08/2013.

I travelled on Oct 4 2012 and Stayed till Oct 2015.

Meantime during my tenture in usa, one more time visa got renewed. Latest visa expired on 28 APR 2016.

Last 2 years im staying back in india and planning for visa Renewal. Does this case consider in CAP exempt?. Not sure how exactly calculates the six years. Is this calculated from Initial petition Start Date/My Initial Travel Date/Latest Petition End date?.

Please reply ASAP.

Thanks in Advance.

Shafeeque