That's tricky. Not only CAN you be a WY resident; you MUST be a WY resident, for tax purposes, under certain circumstances. If the job is expected to last more than a year and you have WY residence, most states would consider you to be a WY resident for tax purposes.
That's the usual rule for state income tax. What makes your situation tricky is that WY doesn't have an income tax. MT can and may take the attitude that you are still a MT resident for tax purposes, since you maintain a home there that you regularly return to.