lwm follows the usual X schema. After downloading, decompressing and un-tar'ing the distribution, change into the new lwm directory and type:
xmkmf ; make
Assuming everything goes well, you'll have an lwm binary in your current directory.
If you don't have Imake or if you don't have it correctly configured, you can use the example Makefile as a start. It works as supplied on IRIX systems, and possibly on Solaris too. The main problem you're likely to have is if your X libraries aren't in the same directory as your other libraries. Then you'll want to find / -name libX* -print to find out where they're kept, and add that directory prefixed by -L to the line that causes the linking. But try it the other way first!
You need to kill your current window manager before you can start lwm. On some systems, killing the window manager will log you out. In that case you'll have to look at altering your xdm(1) configuration or your xinitrc. Whatever, you might find terminator a useful program.
On more sensible systems (only IRIX springs to mind, and some of the other things it does mean it doesn't deserve the accolade "sensible") you can just kill your current window manager and start lwm.
There is no way to exit lwm. I don't believe that you should need to exit your window manager. You can kill it (and if you kill it gently it will leave your machine in a sensible state) to start another window manager. If you want to log out, you should end your session. How you do this depends on how your system manages a session.
Under IRIX, you can type endsession -f (without the -f, this acts like "Log Out" from the toolchest). With terminator you can type terminator at a shell prompt or run it from your favourite menu system.
An alternative would be "real" X session management, but I've never tried that and have no idea how well lwm copes with it.
The xsetroot command lets you set many of the root window's parameters. To set the colour, you pick a colour name from rgb.txt (or a book on writing HTML: the named colours used in HTML are the X11 colours) and then execute:
xsetroot -solid colourname
The colour lightskyblue4 is a nice one, as is darkslategrey.