What is the criteria for making gNb Scell to PSCell and PScell to Scell

What is the criteria for making gNb Scell to PSCell and PScell to Scell . I mean how we can make gNB Scell to PSCell, based on which event and what condition needs to meet to change Scell to Pscell?