You have to start out with decent credit. You do not need to have a 750 credit rating, but you cannot have any collections or recent late payments. A score of 600 or more is advisable. You should also have at least two items on your report that qualify as revolving credit with a low balance. These are typically lines of credit or credit cards.
Be willing to purchase points. A point typically costs 3% of the total loan amount and will lower your interest rate anywhere from half to a whole percent depending on the market and the bank. These actually work out to your benefit in the long term.
A shorter term loan will help you to get low mortgage interest rates. The reason is that you are a better investment if you are willing to pay off the loan at a shorter term. This does mean that your monthly payment will be higher, but you will save a ton in interest in the long run.
Here is an example. A bank may
offer a $300k loan at 5.99% interest for 30 years. On top of the $300k you will pay about $347k in interest. At the same bank, you can get a $300k loan at 5.875% interest for 20years. On top of the $300k you will spend $211k in interest, a difference of $136k. The monthly payment on the 20 year is only $330 higher than the 30 year, so that is the better option if you can afford it.
Bartering a bit can get you a lower interest rate. Start by getting unofficial quotes on mortgage rates from lots of different brokers and banks. Take the best ones and allow a handful to run your credit to get an official quote. Take the best quote to the other banks and see if anyone is willing to beat it in order to get your business. This is a lesser known tactic. The banks will tell you that they will not barter, but many managers at banks are willing to make exceptions if you are going to walk away.