You can deduct up to $10,000 for a “first” home purchase. However, the term first home purchase is loosely defined. If you or your spouse did not own a “principal residence” for the last two years. So a vacation home doesn’t really count for the first home purchase.
The other thing you have to keep in mind, you should have used the fund from the IRA within 120 days of withdrawal for your home.
If your question was more along the lines of building vs buying, the answer is yes. Building a home with roth IRA funds is acceptable.