If you enter a building with the intent to commit theft, GBH or crim dam, you commit burglary (s9(1)(a) Theft Act 1968).
If you enter a building and then commit or attempt to commit theft or GBH, you commit burglary (s9(1)(b) Theft Act 1968).
If you enter as a trespasser to seek shelter, you may commit an offence under s4 of the Vagrancy Act 1824 but you won't commit any burglary offence.