How does AI choose characters from roster?

Can anyone tell me how the AI chooses the characters from my roster when representing me? Is it the last three characters I used in that event?
Thanks!

For retaliations, it’s the team you used to beat them with. For everyone else, it’s the team that you last won with.

Thanks a bunch!