You have to be informed that you're not allowed to be on the premises ("trespassed") and be allowed to leave before you can be charged with trespassing.