There are a few different ways to share a mouse between two computers. The most common way is to use a USB mouse and plug it into each computer in turn. Another way is to use a wireless mouse, which will work with both computers as long as they have an available USB port. There are also some special mice that come with software that allows them to be used with multiple computers.
If you want to use the same keyboard and mouse for both computers, there are a few options available. You can buy a special KVM switch (Keyboard, Video, Mouse) that will allow you to plug both keyboards and mice into one unit and switch between the two computers. Alternatively, there are some software packages that will allow you to share peripherals between two computers over a network connection.