I’ve heard that there is a 4-year rule that allows you to get planning permission. What exactly is it?

The 4-year rule that you refer to is probably the ability to apply for a Lawful Development Certificate (LDC) if you can prove that your building was completed more than 4 years ago and it has been used continuously as a dwelling for more than 4 years. If the LDC is awarded, then it means that the existing use of your building is considered lawful for planning purposes.