I am considering purchasing and occupying a 2-family home, however would like sole use of the backyard. Is it legal to put in a lease that the tenant is not allowed to be in the backyard ever?
You can restrict your tenant's use of the yard by putting that prohibition in the lease. As Mr. Chertock has pointed out, however, this may limit your ability to rent the apartment and the amount of rent you can charge. You may want to consult your neighbors to see how they deal with this issue.