(a) Income derived by a lessor of real property upon the termination, through forfeiture or otherwise, of the lease of such property and attributable to buildings erected or other improvements made by the lessee upon the leased property is excluded from gross income. However, where the facts disclose that such buildings or improvements represent in whole or in part a liquidation in kind of lease rentals, the exclusion from gross income shall not apply to the extent that such buildings or improvements represent such liquidation. The exclusion applies only with respect to the income realized by the lessor upon the termination of the lease and has no application to income, if any, in the form of rent, which may be derived by a lessor during the period of the lease and attributable to buildings erected or other improvements made by the lessee. It has no application to income which may be realized by the lessor upon the termination of the lease but not attributable to the value of such buildings or improvements. Neither does it apply to income derived by the lessor subsequent to the termination of the lease incident to the ownership of such buildings or improvements.
(b) The provisions of this section may be illustrated by the following example: