How do I switch over between 2 AC power supplies with circuit breakers
I'm afraid the already given comment should be taken more seriously than you think. The switching system must obey local code for mains AC supply systems and also everything that the building owner and the mains AC supplier wants. Building your own version and using it in secrecy is very likely criminal and it will also be a high risk for fire and other serious damages if you are not a competent designer &amp; electrician. I doubt you are not because this question is written.
Ask the local mains AC supplier what to do.
Pure technical problems that a beginner do not easily spot

the ability to break circuits in all cases without burning arcs in the switches
preventing in all cases accidental connection between the generator and the external supply, a human must have no way to turn something in wrong order
making sure that no equipment get too fast new unsynchronized voltage so that a high current switching transient is caused. A running motor must be stopped before an unsynchronized new source can be connected.
preventing too high load for the generator - if too many high current devices are started at the same time the cumulated starting transients can be to much for the generator. The high current loads should be switched on one by one

In theory the generator could be synced with the grid if you have the grid voltage ON and the generator has the needed circuits. The grid defines its phase angle as it likes.