As far as I can tell, only the 2nd row down can be customized by pinning. Long press each of those 4 items and make sure they're all Unpinned first. Then choose something from the main Apps list below, long-press, and Pin. Do that for your 4 preferred apps, and they should populate the 2nd row one by one.
Glad that cleared it up for you! I had never really looked into pinning apps on the Share menu myself, so I learned a little something myself.My guess is that the top row is selected by the system based on recent or frequent sharing.
I don't think the user can manually pin a contact to the first row -- you can unpin someone in that list so that they get replaced by the next people you contact, but I don't see a way to pin a different contact there.
Did you already try unpinning the contacts who are currently in the top row? Long-press one of them and see if it gives you the option to Unpin.
If you unpin a contact, then I think they can be replaced by the next contact you message or call -- but the system will do that, not you. So try unpinning the ones you don't want, and the next time you call or message one of the contacts you do want to pin, see if they show up in that Share menu, and then make sure they're pinned.
It might be based on the last few people who contacted you (rather than the ones you contacted). That's the pattern I see right now on my phone, but I'd have to keep track of it for a few days to see how that changes.