"When do I use the verb haben (to have), when do I use sein (to be)?
This is an interesting question because even though the usual answer is that most verbs use the auxiliary verb haben in the perfect tense (however watch out for common exceptions stated below), sometimes both are used depending from which part of Germany you're from. For instance, northern Germans say Ich habe gesessen, whereas in southern Germany and Austria they say Ich bin gesessen. The same goes for other common verbs such as liegen and stehen. Further, the German grammar "bible" der Duden mentions that there is a growing tendency to use increasingly the auxiliary verb sein with action verbs.
However, rest assured. These are just other uses of haben and sein to be aware of. In general, keep the following tips and guidelines in mind when deciding between these two auxiliary verbs and you'll get it right.
In the perfect tense you use the verb haben...
Sie haben das Auto gekauft? - You (polite form) bought the car?
In these cases it will be when the intransitive verb describes an action or event over a duration of time (as opposed to an action/event that occurs in one moment of time -> Mein Vater ist angekommen).
Die Blume hat geblüht - The flower bloomed.
Er hat sich geduscht - He took a shower.
Die Verwandten haben sich gezankt - The relatives argued with each other.
Das Kind hat die Tafel Schokolade kaufen wollen - The child had wanted to buy the chocolate bar.
(Please note: You see sentences expressed in this way more in written language.)
In the perfect tense you use the verb sein...
Ich bin schon in Deutschland gewesen - I've already been in Germany.
Meine Mutter ist lange bei uns geblieben - My mother stayed with us for a long time.
Ich bin heute gegangen - I went today.
Du bist nach Italien gereist - You travelled to Italy.
Er ist mehr schüchtern geworden - He has become more shy.
Compare Wir sind durch den Saal getanzt - We danced throughout the hall
With Wir haben die ganze Nacht im Saal getanzt - We danced the whole night in the hall.
Die Blume ist erblüht - The flower has begun to bloom.