Your Xbox Live account (Gamertag) can only be signed in on one Xbox 360 at a time. Signing in on a second console automatically signs you out of the first.
Always sign out on Console A before signing in on Console B. Inconvenient but costs nothing.
Create a separate Gamertag for the second console. Each account needs its own Xbox Live Gold/Game Pass subscription for online/multiplayer.
Choose based on budget and how often you switch consoles.