What is the main factor to consider in determining the type and configuration of foundation for a residence?

What is the main factor to consider in determining the type and configuration of foundation for a residence?