That depends on what type of tree. Usually, you wouldn't plant closer than one half of the expected mature height away from the house. Then there is the added consideration of what the root system is...
Depending on the area that you are in there are many varities that you cold use.
Little Gem Magnolia, Stevens Holly, Foster Holly, Crape Myrtle, Carolina Laurel, Indian Hawthorn, Trident Maple,...
If you bought a live tree with a root ball, you simply dig a hole and plant it. Most trees are already cut off the roots and as such cannot be planted, at least not in any way that they will grow.