so I have a 2 and a 3 year old so this is a problem I face on a daily basis. I haven’t cracked it by any means, but here is what I do:
no hitting rule is consistently and firmly enforced. Obvs some hitting still happens but they are both separated and my 3 year old will have a consequence (my 2 year old is only just 2, so he will just be removed from whatever situation it is and I will repeat that we don’t hit etc)
I am always vigilant to stop a fight before it becomes one if I can, by distracting etc.
try to split up playtime’s into some independent play and then some joint play, they fight more when they are together longer
favourite toys are not always shared, rather they can be played with away from the other one (for example my older one had a great toy recently that I knew would get trashed by her brother, so she plays with that on her own at the table or in her room) although most stuff we try to share.
I am keen on asking them to talk to each other nicely, say please can I have, rather than taking (again mixed results at this age but sometimes they really surprise me with how kind they can be)
I remind constantly about being kind, taking turns, sharing, no hitting, that we look after each other etc and praise lots for kind behaviour.
we have lots of outside time where they are not stuck together, which I think helps everyone.
I do think some kids are more likely to get on than others though - good luck x