There is a mitzvah to have a mezuzah by all doorways no matter how many rooms there are. Every time a person enters or leaves their home or passes through any doorway, they should see the mezuzah and remind themselves of ‘יחוד ה and their love for Hashem. The mezuzah is as well a protection for the house from מזיקים and גנבים, and is a segula for many other things. The Rambam writes that one who wears tzitzis and tefilin and has a mezuzah will not sin because the tzitzis, tefilin, and mezuzah are reminders for him and they are the messengers of Hashem that save him from sin.