I think the rule is pretty clear on this, below is a link and it answer frequently asked questions:
What is the definition of a first-time home buyer?
The law defines "first-time home buyer" as a buyer who has not owned a principal residence during the three-year period prior to the purchase. For married taxpayers, the law tests the homeownership history of both the home buyer and his/her spouse.
For example, if you have not owned a home in the past three years but your spouse has owned a principal residence, neither you nor your spouse qualifies for the first-time home buyer tax credit. However, unmarried joint purchasers may allocate the credit amount to any buyer who qualifies as a first-time buyer, such as may occur if a parent jointly purchases a home with a son or daughter. Ownership of a vacation home or rental property not used as a principal residence does not disqualify a buyer as a first-time home buyer.