How often is Ratchet key pair changed in signal protocol? At first I thought the new ratchet key is created with each first incoming message. After that I believed it depends on the implementation. But after closer look at the signal documentation and following picture, I am left even more confused.

The picture above shows Alice sending message A2 and after that receiving message B2 from Bob, which uses his old key. How is this possible?
Shouldn't Bob update his key on receiving Alice's A2 message. Message A2 features a new ratchet key, and should trigger DH ratchet on Bob side and update his Receiving and Sending chain, thus his next message (B2) would use a newly created key?
What I am missing here?
First, how often is a new DH ratchet key is decided by the implementation.
Alice will trigger a DH ratchet step when she receives a new public key in the header of the message sent by bob (section 4.1 of double ratchet specification[0] goes into the detail of it). In this case, B2's header did not have a new public key, while B3 and B4 do.
Coming to your question, It doesn't matter if A2 had a new key or not. Why? Because this protocol allows for messages to arrive with old keys. Think of the case where Alice's message is not delivered but bob keeps sending message(s).
[0] https://signal.org/docs/specifications/doubleratchet/