The qualifying criteria for ILR depends on your current visa status and may also be affected by any previous visas you may have held whilst resident in the UK.
You will need to meet the criteria for ILR under your specific visa route.
In addition you must normally not fall under the “general grounds for refusal”. For example, if you have recently acquired a criminal conviction, that might affect your eligibility to apply for ILR.