Hi Poppy
So far it's OK to rent a room or two in your property, Barcelona government is working to give room-licenses but until that happens it's legal to rent.
So about your questions....
1.- As long as it is your residence and you live there/are present while guests are there.
--- we have to add that you need to be THE OWNER of the property and live and be in the " padron "
some people are confused, if you are the tenant and you want to rent rooms in the apartment you live in, you will need to ask for permission to your landlord otherwise you will be evicted, and lose the deposit of your apartment when the owner knows
2.- As long as it's no more than 2 rooms in your house being rented out.
--- YES
3.- That each rental is less than 28 days.
---- YES
4.- As long as it is not for more than 4 months in total out of 12 months.
--- this I have not hear it before, I think this is for Madrid area.
Any other question, just write me.