rules for taking out a mortgage