# Splitting of exact triangles in derived category

Let $A\to B\to C\to A$ be a distinguished triangle in a (bounded below) derived category of an abelian category.

Is there a necessary and sufficient condition that it splits, namely $B\simeq A\oplus C$ in a way compatible with the morphisms in the triangle?

Remark. A necessary condition is that the image of the identity morphism in $id\in Hom(C,C)\to Hom(C,A)$ vanishes. This condition is sufficient provided all the objects $A,B,C$ belong to the given abelian category (rather than derived one) and form a short exact sequence. I do not know if this condition is sufficient in general.

In any triangulated category, the necessary and sufficient condition for a distinguished triangle $A\to B\to C\to A$ to split is that the morphism $C\to A$ in this distinguished triangle vanishes. This morphism is the same thing as "the image of the identity morphism under $Hom(C,C) \to Hom(C,A)$" that you mention in your Remark.
Indeed, this condition is necessary, because, given a splitting $C\to B$ of the morphism $B\to C$, i.e., assuming that the composition $C\to B\to C$ is the identity morphism, our morphism $C\to A$ decomposes as $C\to B\to C\to A$, which is zero since the composition $B\to C\to A$ in any distinguished triangle vanishes.
This condition is sufficient, because, for any distinguished triangle $A\to B\to C\to A$ with a zero morphism $C\to A$, applying $Hom(X,-)$ for any object $X$ in your triangulated category produces an exact sequence $0\to Hom(X,A) \to Hom(X,B) \to Hom(X,C) \to 0$.
In any additive category (and a triangulated category is additive by definition; in particular, any derived category is additive), exactness of such sequences for all objects $X$ implies a splitting $B\simeq A\oplus C$ compatible with the morphisms $A\to B$ and $B\to C$.
Indeed, taking $X=C$ you can see that there is a morphism $C\to B$ such that the composition $C\to B\to C$ is the identity morphism. Denoting by $f\colon B\to B$ the result of subtracting the composition $B\to C\to B$ from $id_B$ and taking $X=B$, you can see that there is a morphism $B\to A$ such that $f$ is equal to the composition $B\to A\to B$. So $id_B$ is the sum of the two compositions $B\to A\to B$ and $B\to C\to B$.
Finally, the composition $A\to B\to A\to B$ is equal to $A\to B$, since the composition $A\to B\to C\to B$ vanishes. As the morphism $Hom(A,A)\to Hom(A,B)$ is injective (take $X=A$), it follows that the composition $A\to B\to A$ is equal to $id_A$. The two morphisms $A\to B$ and $B\to C$ that we had to begin with, together with the two morphisms $C\to B$ and $B\to A$ that we have found, provide the desired isomorphism $B\simeq A\oplus C$.