With Google Authenticator, you scan a barcode into your phone and it generates a temporary 6-digit key every minute, regardless of whether the app is open or not. It is not limited to one person, just to one account. These codes rely on times being in sync so that when an authenticator code expires, it expires on the site as well. Most use two protocols - HOTP and TOTP.
Highlights from this answer: https://security.stackexchange.com/a/35159
HOTP = Client and server share a counter, when code generated, timer increments, producing a new one-time login code.
TOTP = HOTP except the counter is replaced by the current time. So long as the system times are in sync, both the client and the server will be on the same page as far as what 2FA code is currently the correct one.
If multiple people scan this barcode, they will all generate the same keys. Thus, all you need to do is have both people present when setting up two-step authentication (or save the barcode if they have incompatible schedules, but be sure to shred it later), and they will both be able to access the account whenever they want.
Due to best OpSec practices, it is best to have separate 2FA keys, or use an alternative method, such as key-pair authentication where each user has their own key to access the server. This is better for auditing purposes where you can determine more easily the difference between different users, especially if one user decides to do something malicious using a shared authentication code.