Dungeon Keeper 2 has no in-game windowed option, so you have to change a registry value. Open the Run box, type Regedit, and navigate to:
Computer, HKEY_CURRENT_USER, Software, Bullfrog Productions Ltd, Dungeon Keeper II, Configuration, Video
You must have launched the game at least once for that key to exist. Double-click Screen Windowed, set the base to Decimal, and change the value data to 1. Launch the game and it starts in a window.
Be aware this is unreliable on Windows Vista and Windows 7, particularly the 64-bit versions, where it either does nothing or introduces graphical glitches. Back up the registry branch before editing it.