I came across this some time ago but thought I would post it as it provides a breakdown of what weight certain factors play in determining your credit score.
As you can see the largest overall factor in determining your credit score is your payment history followed closely by the amounts owed.
One thing that always seems to affect my credit is the length of credit history. Because I moved to the USA from another country my credit history is relatively short compared to that of most Americans the same age as me.
Here is another grahpic from Experian showing the “credit quality” of certain types of credit.
I currently don’t have a mortgage so that could be hurting my credit. I do have an auto loan though which is a type of installment loan. Obviously, I have some credit cards but also some retail cards like Walmart and Amazon.