You can solve this using sticks and stones strategy.
However I am going to do case work because its simpler
Case 1: There is maximum 1 person in each room
Obviously 4! so 24 for case 1
Case 2: There are maximum 2 people in each rooms
So we can list possiblities
If ONLY 2 or 0 people can be in a room, then it is 2! => 4
If 2, 1, and 0 people can be in a room, then it is 3! => 6
So 10 cases for case 2
Case 3: There are Maximum 3 people in each room
Just like case 2 we can list possibilities
If ONLY 3, 1, and 0 people can be a room then it is 3! => 6
Thats all for case 3 so we have 6 because some of our possibilities were already done for case 2
Case 4: There are 4 people in one room with three other empty rooms
Obviously 4.
To find the answer we won't multiply the cases we will add them.
4+6+10+24 = 44 ways we can put 4 people in 4 bedrooms.