You cannot spend more than 2 years outside the UK to maintain the ILR status. If an applicant is absent from the country for longer, it might result in losing ILR and requiring a returning Resident visa to re-enter the UK.