How to determine who is the PI and who the co-PI?
There are some significant issues that may influence the selection of a PI versus a co-PI or co-I. There are grants where eligibility requirements may vary, depending on whether someone is a PI versus a co-I. For instance, some programs may have a requirement that an investigator may apply for only one grant as a PI, but could act as a co-investigator on multiple proposals. 

In addition, the PI will likely have additional reporting requirements or be responsible for ensuring the coordination of reporting for the entire team. 

There might also be "programmatic" reasons for selecting the PI—for instance, if the program is designed to particularly support a particular kind of institution, having someone from that kind of institution as PI could be useful.

But, in general, there are so many different programs that, in the absence of more specific information about the program, it's hard to give any kind of general guidance about how to select a PI.