The laws on trespass are quite convoluted.
That said, they're also very simple.
If you don't have permission to enter land you don't own, or land open to the public, don't enter.
If you are trespassing and commit OTHER crimes, you're simply escalating potential penalties.
Be smart, don't trespass, leave when requested if you enter by mistake, and don't threaten the owner (or caretaker) as you are leaving.
Simply put, don't go or remain where you are unwanted!
Here are the trespass laws explained by an OK lawyers: