Tis is a great question and the truth is the rates change daily.
Typically people lock in a 30 year fixed loan, but there are many other types.
Your own personal credit rating will determine what your rate will be.
Rates are at 50 year lows, basically in the 3+% range so it is a god time to buy at these rates.
Of course sitting with a pro is your best bet.
They ask for your income, your down payment, your other debts, etc
Reply back in you want a great referral
Tell me where you are buying too
Maybe I can help if you need