You can connect the Sony WF-1000XM5 to two devices at the same time. To find out how you can properly use the earphones for more than one device simultaneously, you can check out this guide from Seeking Tech.
Pairing the WF-1000XM5 on multiple devices
If you haven’t done so already, make sure you pair the earbuds to your devices.
If you haven’t paired the WF-1000XM5 yet, then you need to remove the earphones from the charging case. By doing so, the two buds should enter pairing mode automatically.
If you have already paired WF-1000XM5 once, then you have to leave the earbuds in the charging case but keep the lid open. Afterwards, press and hold the pairing button on the back of the case for at least 5 seconds to enter into pairing mode.
With the earphones awaiting to be paired, go to the Bluetooth menu of your devices to complete the pairing and connection process.
You can find the official video on the pairing process below:
If you try to connect the earbuds to a third device, then only the third device and whichever device that last played music will stay connected. The other one will be dropped from the connection.
How music playback works with two devices
If you have two devices connected at the same time to the WF-1000XM5, then the earphones will prioritize music playback on the device that first initiated playback. Thus, the touch controls on the earphones will be applied to that music playing device.
If you want to switch the music playback to the other device, then you need to stop music from playing on the first device before you play music on the other one. The touch controls should automatically be switched to the other device as well.
If you try to play music on the other device while the music is still playing from the first device, then the earphones will prioritize the sound output from the first device.