An accessory building may be erected either attached or unattached to a principal building on the same lot. An attached accessory building shall be considered a part of the principal building and shall comply with the requirements of the district in which it is located. An unattached accessory building in any Residential ''R" district shall be located in the rear yard of the principal building but shall not: Occupy more than 30 percent of the area of the required rear yard; be located closer than 15 feet to the principal building on the same lot or any principal building on an adjoining lot; be located closer than five (5) feet from any rear or interior side lot line; project into any required front or street side yard. On corner lots the accessory building may not be located closer than 25 feet from the road right-of way. Except that unattached accessory buildings 400 square feet or less which are used for private, noncommercial and non-dwelling use of the resident may be built in the rear yard or side yard in A-1, R-1 and R-2 districts and shall not require a building permit.