Edited as the most recent update made it no longer all random:
Using the following Diagram:
Unit 1 is set by placing a hero in the first slot of your first party.
(You can tell which party is your first by looking at the white circles under the party switcher)
This is the unit everyone in PvP and your friends will see when they challenge or greet you.
Units 2, 3, 4, and 5 are the members of your currently selected party.
IF YOUR FIRST PARTY IS SELECTED, Units 2, 3, and 4 will be the other members of that party, as Unit 1 is already in the party, and Unit 5 will be random.
Units 6, 7, and 8 are all random units, see below.
Unit 9 is one of your friends, your friends will appear at the bottom.
I've confirmed this by going to the Home screen, then the Battle screen over and over again, each time the bottom characters changed.
For the random slots, there were no patterns, not in the colour of units that appear (there were times where most of them were red, and times with no reds at all), not in weapon, level, star rating, or who is on your other teams.
You can even get two of the same hero, I have a 4-star and 3-star Olivia, and both just showed up at the same time.