- Common carrier arrival manifests.
- Visa stamp process arrival record and I-94 issuance. [4]
- US-VISIT biometrics collection on arrival. [2]
- Form I-9 when starting a new job. [3]
- Form AR-11 every time they move. [1]
- Common carrier departure manifests.
- Tax returns.
As far as I can tell the only people who "sneak out" do so by crossing the border into Canada and the US should have access to that data from Canadian authorities after the fact also.
[1] https://www.uscis.gov/ar-11
[2] https://www.dhs.gov/xlibrary/assets/usvisit/usvisit_edu_trav...
Therefore, since there is no way to detect when an H1B worker leaves the country, there is no easy way to estimate the number of H1Bs currently in the country.
This site will let you search your own travel history with both arrival and departure dates - https://i94.cbp.dhs.gov/I94/#/history-search