You want multiseat. This allows the same computer to be used by several users at once without interfering with each other. For example here i have one 'seat' with dual screen and pro-audio stuff at the desk i'm typing from right now, and another one with the TV in the room with extra keyb+mouse, sound goes through HDMI to the TV. This way my wife & i can be, let's say one of us at the desk, the other in the bedroom reading/watching/playing different stuff, like if each room had a different computer, but they share the same CPU, RAM, storage, etc. (Both screens at the desk are on the same graphics card, i'm not sure how much more complicated or even possible it would be if they weren't)
These days multiseat is integrated in systemd and the display manager (lightdm, etc) so it makes it a bit easier to set up - though it's still possible to do without, ie. on older / no versions of systemd. Actually this is just a front-end that creates the udev rules for you.
Normally you'd use the command 'loginctl' to see or change seat setup. 'loginctl seat-status' will show you a list of hardware attached to each seat. To attach a device to a seat rather than the default one 'seat0' you use 'loginctl attach (seat-id) /sys/devices/(spec of which device)' - you can get the spec/path of the device from 'dmesg -w' when you plug/unplug the device, or from commands such as 'lspci' or 'lsusb'.
Seats are added/removed automatically (seat0, seat1 etc) when either some or no hardware is attached to them. So if you attach something to nonexistent seat2, it will be created on the fly, then it will be removed when no more hardware is assigned to it.
More info:
https://www.freedesktop.org/wiki/Software/systemd/multiseat/
https://wiki.archlinux.org/title/Xorg_multiseat