Home office- separate building

I have read the tax laws and don’t understand the following:  if we buld a separate shed on our property for use as a home office is the cost of building it deductible?  And if my husband, as an insurance agent, switches from being a free agent on 1099 pay to an employee, but will

still get residuals for his independent contracting work, can we still claim the home office deduction ?