As builders we advise planting the tree at least as far away from your home as the expected height of the tree. If the tree is expected to exceed 30 feet in heght, plant it 35 feet or more away from your home. This will ensure the roots and moisture from watering tree won't damage the home's foundation and any limbs that eventually break won't land on the roof.
Many will argue this, stating the energy savings from the shade canopy of large tress is more important than the integrity of the foundation and roof. Although you will see some energy savings, it probably won't calculate into any savings long term once you have the tree removed and damages repaired. We feel that is more a question of proper tree/plant selection. A 30 foot alepo pine had no business being up next your home, when a tressli with a vine will accomplish the shade without damagin anything.
Image Caption 1 & 2: The roots from this 50 foot tall pine tree approximately that was only 20 feet from the home, grew under the footing and up inside the home where it came in contact with the 2” ABS shower drain pipe. As a result it eventually crushed the pipe and broke it in half preventing the shower from draining.
Image Caption 3-5: Pine tree next to foundation heaved and cracked the foundation and the drywall inside. Several doors inside the home were also unapprable as a result.