Simple one page form from the IRS. Must be more than 50 miles, though. And intend to stay 36 months or more. Intend, not actually have been there that long.
Edit irs
OOP's remembered it wrong. Weeks not months. But again, it's if you intend to be there that long it's immediately deductible. For example if you move in Dec. the amount is deductible the following year, even if you haven't met the time requirement yet.