basic meaning (in a family tree)
오빠 is used when female sibling calls an elder brother
형 is used when male sibling calls an elder brother
further meaning (in peer community)
a female can call elder male senior who is quite close and friendly, but these days, usually a woman (teens, twenties..) calls her boy friend 오빠
So you should be careful when you call someone senior to you 오빠, because it can cause other's misunderstanding about your relation
A male can call elder male senior who is quite close and friendly. Let's say you are male and there is another male who is just one year older than you
You can call him 형, It sounds as if you two have close friendly relationship
고맙습니다. Thanks so much for the detailed explanation. It's so helpful to me.
Good to know.