Avere and Essere are both auxiliary verbs. In other words they are the 'helper verbs' which have to be there in order to form compound tenses.
So, if we take the perfect tense then, just to recap, we need to remember that there are 2 separate parts:
1) The auxiliary- Avere or Essere (such as 'ho', 'sono stato' )
2) The past participle - 'mangiato' or 'andata' for instance.
In simple terms, Avere (to have) is used for:
1) All transitive verbs- these are verbs that always take a grammatical direct object- in other words we can ask the questions, what? or who? after them.
For example: ho mangiato due pizze, ha già studiato la lezione.
2) But sadly there are some exceptions so some Intransitive verbs also take Avere. Some common examples are:
CAMMINARE (to walk), PASSEGGIARE (to stroll), VIAGGIARE (to travel), NUOTARE (to swim), BALLARE (to dance), DORMIRE (to sleep).
eg: Ho dormito molto ieri.
Essere is used for: Intransitive verbs - those that don't take a direct object, and can't give an answer to who? what? Also, rememeber: The past participles have to AGREE.
So these are:
1) All verbs of movement (I like to remember this by thinking that Essere has two 's's and well, if we imagine a stick man, these could look like a runner!) Eg: sono partito presto
2) Verbs that show a change of state. For instance: sono cresciuto(-a) (remember that when we use Essere, all the past participles must agree with the person who is doing the action. So here, -o is the singular masculine ending and -a is the singular feminine one.)
3) Reflexive verbs also use Essere. For instance, we could say: ci siamo alzati/e alle 7, (again here the -i/-e, this is for agreements- the -i is the plural masculine ending and the -e is the plural feminine ending).
There are a few odd cases though, and either can be used depending on the meaning
1) The Weather: can use either
2) Cominciare: - in the sense of a state or to describe when something started = Essere. Eg: Il programma è gia cominciato. In the Iniziare sense- the actual act of starting, use Avere. Eg: Ho cominciato un nuovo libro.
3)Finire: - in the sense of a state or to describe when something finished= Essere. Eg: A che ora è finita la lezione? But, if the verb shows an act of finishing and in the majority of cases is followed by a 'di', use Avere. Eg: Ho appena finito di leggere il libro.
4) Correre: - if a specific destination is mentioned use Essere. Eg: Sono corso alla stazione. For anything else, use Avere.
5) Cambiare:- to describe a state use Essere: La vita è cambiata molto per i giovani. But to describe an act of changing use Avere: Ha cambiato la macchina- He physically changed his car.
6) Salire/ Scendere: For the descriptive sense, or to describe a state, use Essere: Sono salita sull'autobus. For the act, use Avere: Ho salito le scale a piedi.
7) Aumentare/ Diminuire: For the state, or a description use Essere: I prezzi sono molto aumenti. For the acts, use Avere: Il governo ha aumentato le tasse. The government are actually rising the....
One other thing to be aware of: Modal verbs- Dovere, Volere and Potere- these use the auxiliary that the following verb needs. Perhaps we can imagine it this way, modal verbs are 'super helper verbs' and even use the 'helper verb' that the verb they are helping needs. So, for instance:
- Ho dovuto mangiare una pizza- mangiare is a transitive verb and needs Avere, so Dovere takes avere too
To sum up: If a verb is transitive it takes Avere, if a verb is intransitive it takes Essere.
There are a few exceptions where both are possible- with finire, cominciare, correre, cambiare, salire, scendere, aumentare, diminuare- if the verb is indicating more of a state, use Essere, more of an action, use Avere.