It is counted since the first day of your status if you did not leave U.S. for more than 6 month. If you'r the principal applicant, your wife do not have to stay in U.S. for more than a year.