Ah! the famous auxiliary verbs. Here is a handy guide -
You use "avere" with ACTIVE TRANSITIVE verbs. Here is an example
Io HO mangiato - I have eaten.
The verb "eaten" describes an action carried out by the ACTOR (IO) - that is why we call it an ACTIVE VERB.
Why do we call it an TRANSITIVE VERB? Because the action it deserves "TRANSITA" (transits) from the ACTOR the the OBJECT (I - actor - have eaten ---> the apple, object).
Another example?
Io - ho - amato ( I have loved). Can you tell me how this verb is active and why it is transitive?
ESSERE
We use "essere" when the verb is PASSIVE
IMPERSONAL . i.e.: "sembrare" - "to look like"
"Mi e' sembrato strano" - It looked strange to me
REFLEXIVE VERBS - i.e: lavarSI
mi sono lavato/a ( I washed MYSELF)
INTRANSITIVE verbs
there is no hard and fast rules in this case :(
BUT generally speaking "AVERE" will work, especially if you can tell the ACTOR clearly carried out the action
"Io HO dormito" - I slept, is a good example
ESSERE will go down a treat with verbs indicating movement
"Io ho corso" - I ran
These are the basic! I hope it helps!