With “être”
The past participle conjugated with the french auxiliary “être” agrees in gender and number with the subject.
With “avoir”
The past participle used with the french auxiliary avoir agrees in gender and number with the direct object complement (COD) if it precedes the verb.