Let $R$ be a ring, and $A,B,C$ be $R$-modules. What sufficient or necessary conditions on $R,A,B,C$ should we have such that $$\text{if}\quad 0 \to A \to B \to C \to 0 \quad\text{is exact}\quad \text{then}\quad 0 \to A \to B \to C \to 0 \quad\text{is split}$$ (split means $B \cong A \oplus C$ such that the isomorphism gives a commutative diagram with the given morphisms, and projections).
If $R$ is a field, then I think this is true by the rank-nullity theorem. If $C$ is a projective $R$-module (with $R$ being any ring), or if $A$ is an injective $R$-module, I think this hold.
But what about a sufficient condition on $B$, for instance (semi-simple $R$-module maybe? I'm only thinking about possibly relevant properties)?
Thank you!