You need to reside in the US, and your time in the country should be consistent with this basic requirement.
If you think that there is a "rule" that says X days, and if you do X-1 you are automatically safe and X+1 you are not, then you are mistaken.