There are three ways to accomplish having multiple operating system environments on one system.
The first is to have two physical storage devices containing two separate operating systems. The system is shut down, the boot drive is physically swapped and rebooted, or upon boot the boot order in the system firmware is altered to boot to one drive or another as first priority. This configuration has two entirely separate environments with separate boot files which are entirely unaware of one another.
The second is to have either two physical storage devices or one storage devices with two partitions onto which separate operating systems have been installed. When installing the second operating system, the first is left in the system and thus the second operating system’s setup routine can detect the first operating system and thus provision a selection process for it in the boot files. This configuration has two separate environments but one set of boot files. Configuring this type of setup requires that the setup routine for the last operating system installed is compatible with the boot sequence of the previous operating systems and thus usually, you install the most recent OS last. For example, you would install Windows XP, then Windows 7, then Windows 8 to create a triple boot system with the ability to access any of the three operating systems. There are instructions on configuring multiboot available here.
The third and most modern method is to use virtualization technologies to allow multiple operating system environments to coexist on one hardware environment. If you have Windows 8 Professional or Enterprise, this is the method to use. With Windows 8 Client Hyper-V, you have access to a Type 1 hypervisor which allows virtual environments and the native Windows 8 environment to exist on equal footing. In your Windows 8 environment you could thus have a window open with Windows XP and another with Windows 7.