OK, so first you have to learn by heart which verbs are using être and which others are using avoir but ... That's not all!

Remember also that the past participle agrees with the subject when the auxiliary is être.

Let's conjugate rester (to stay) to illustrate this rule.

rester
masculine subject
rester
feminine subject
to stay
je suis resté je suis restée I have stayed
or
I stayed
tu es resté tu es restée you have stayed
or
you stayed
il est resté elle est restée he/she has stayed
or
he/she stayed
nous sommes restés nous sommes restées we have stayed
or
we stayed
vous êtes restés vous êtes restées you have stayed
or
you stayed
ils sont restés elles sont restées they have stayed
or
they stayed

Don't make the past participle agree with the subject when using avoir as an auxiliary.