Investors & landlords

Refer to IRS Pub 550:

Writers of puts and calls. If you write (grant) a put or a call, do not include the amount you receive for writing it in your income at the time of receipt. Carry it in a deferred account until:
Your obligation expires;
You buy, in the case of a put, or sell, in the case of a call, the underlying stock when the option is exercised; or
You engage in a closing transaction.

 

If a put you write is exercised and you buy the underlying stock, decrease your basis in the stock by the amount you received for the put.

 

Note:  your broker will be (or should be) doing these calculations and adjustments for you.