You are talking about the formation of the past tense called passé composé. The verb in passé composé is made up with two parts: the auxiliary verb « avoir » OR « être » + the past participle of the verb.
Most verbs use the auxiliary verb « avoir », like the verb « finir » (nous avons fini).
Some, however, use the auxiliary verb « être ». It is the case with many verbs of movement like « partir » (nous sommes partis).
So, when you learn a new verb, you should look at its auxiliary verb.
I hope this helps.