Yes, you can.
"The home office tax deduction can be used by taxpayers who are employees (e.g., for a company) or who are self-employed.
If you are eligible to claim this tax deduction but you moved partway
through the year, you can only deduct home office expenses for the
portion of the year during which you used your home office." - IRS.com