French is a language that has lots of grammatical rules and irregularities but there are ways of remembering confusing constructions like this! The general rule is that verbs about movement or the change of state (from one form to another, e.g. being alive to being dead) take être and all others take avoir. To make this even easier and remember the 16 être verbs, just learn the acronym DR MRS VANDERTRAMP. D-descendre, R-revenir, M-monter, R-rester, S-sortir, V-venir, A-aller, N-naître, D-descendre, E-entrer, R-rentrer, A-arriver, M-mourir, P-partir.
You must also remember that these verbs DO agree when used in the passé composé but avoir verbs DO NOT agree.
Être = La fille est arrivée à la maison. / The girl arrived at the house.Avoir = La fille a mangé le gâteaux. / The girl ate the cake.