You can not put two commands in a single spawn. You can use a trick:
b = pexpect.spawn("bash -c 'whoami;users'")
To match newlines, you should use:
b.expect('root\r\nroot user2')
Terminal TTY device drivers (dumb, vt100, ANSI, xterm, etc.) all use the CR/LF combination to mark the end of line. UNIX uses just linefeeds to end lines in files, but not when it comes to TTY devices.
You can read more about it from here.