No official rules. A committee picks the four teams based on record, strength of schedule, etc. I am sure there is also pressure to make good TV.
"bama would be better TV than TCU.
In 2024 it will expand to 12 teams, highest 4 teams voted by committee will get a bye in the first round.
The committee is picked by conference presidents. Typically present college athletic directors, former coaches, players, football writers. Here is this year's committee.
The official 2022-23 Selection Committee Roster for the College Football Playoff
collegefootballplayoff.com
Jim