A 1 year old and a 3 year old can share a room although when a 1 year old and 3 year old share a room it could lead to sleep disruptions in the 3 year old if the 1 year old doesn't sleep very good through the night and wakes up crying and could disturb the 3 year old.
It's best to have a child of 1 years old to sleep in the parents room or a separate room to avoid sleep disruptions to the older sibling but if it's not possible they can share the same room, but just be prepared to have a tired 3 year old in the morning if the 1 year old doesn't sleep too good.
Even a 5 year old and a 1 year old can share a room.
However when a 5 year old and a 1 year old share a room it can lead to sleep disruptions for the 5 year old if the 1 year old doesn't sleep too good through the night or wakes up crying etc.
If possible it's best to wait until the 1 year old is at least 2.5 to 3 years old before they share a room with an older sibling to avoid sleep disruptions.
But sometimes there's no other choice if you have no other room.
If possible it's best to have the 1 year old sleep in the same room as the parents and allow the 5 year old to have a room to themselves or with a similar aged sibling or older sibling to avoid sleep disruptions.
I used to share a room with my 1 year old brother when I was 5 and he would wake me up through the night by crying and not sleeping fully himself.
I would sometimes at 5 go out to the living room and sleep on the couch to get away from the crying.
However if the 1 year old is a good sleeper then it can be okay for the 5 year old to share a room with the 1 year old.
Sometimes you have to do what you have to do.
In the old days even whole families shared the same room or just a one room house.