Clarification on execution of complex script with OP_CHECKLOCKTIMEVERIFY I'm quoting this example of BIP65

BIP 65 has this bitcoin script code

 IF
    &lt;now + 3 months&gt; CHECKLOCKTIMEVERIFY DROP
    &lt;Lenny's pubkey&gt; CHECKSIGVERIFY
    1
 ELSE
    2
 ENDIF
 &lt;Alice's pubkey&gt; &lt;Bob's pubkey&gt; 2 CHECKMULTISIG


And with this bitcoin scriptSig is possible unlock the transaction


Now with this ScriptSig 0 &lt;Alice's signature&gt; &lt;Bob's signature&gt; 0
after 3 months with this ScirpSig 0 &lt;Alice/Bob's signature&gt; &lt;Lenny's signature&gt; 1


But I don't understand this part of If-then-else

ELSE
    2


When is it executed and what I don't understand inside the if-then-else condition?
Bitcoin uses a stack based language due to which the logical condition that will execute the IF or ELSE statements comes prior to the operator IF or ELSE. Let's take both your cases one by one and see how it gets executed on the stack.

Case 1: ScriptSig: 0 &lt;Alice's signature&gt; &lt;Bob's signature&gt; 0


The stack starts at 0 &lt;Alice's signature&gt; &lt;Bob's signature&gt; 0
Since 0 is on top of the stack, the ELSE condition will execute and drop the 0
number 2 is pushed on the stack
Stack is now 0 &lt;Alice's signature&gt; &lt;Bob's signature&gt; 2
script outside the IF/ELSE statement is pushed to the stack
Stack is now 0 &lt;Alice's signature&gt; &lt;Bob's signature&gt; 2 &lt;Alice's pubkey&gt; &lt;Bob's pubkey&gt; 2 CHECKMULTISIG
This is a normal 2-of-2 Multi-sig operation that will execute by verifying both Alice's and Bob's signature to the public keys


Case 2: ScriptSig: 0 &lt;Alice/Bob's signature&gt; &lt;Lenny's signature&gt; 1


The stack starts at 0 &lt;Alice/Bob's signature&gt; &lt;Lenny's signature&gt; 1
Since 1 is on top of the stack, the IF statement will execute and drop the 1
&lt;now + 3 months&gt; CHECKLOCKTIMEVERIFY is pushed to the stack and verified whether 3 months have passed. If yes, the execution will continue. 
DROP operator drops the TRUE on top of the stack if verification is successful
&lt;Lenny's pubkey&gt; CHECKSIGVERIFY is pushed to the stack
Stack is now 0 &lt;Alice/Bob's signature&gt; &lt;Lenny's signature&gt; &lt;Lenny's pubkey&gt; CHECKSIGVERIFY
CHECKSIGVERIFY will consume the top 2 items of the stack. It will check whether Lenny's signature matches Lenny's pubkey. If yes, the execution will continue.
Stack is now 0 &lt;Alice/Bob's signature&gt;
1 is pushed to the stack
Stack is now 0 &lt;Alice/Bob's signature&gt; 1
Script outside the IF/ELSE statement is pushed to the stack
Stack is now 0 &lt;Alice/Bob's signature&gt; 1 &lt;Alice's pubkey&gt; &lt;Bob's pubkey&gt; 2 CHECKMULTISIG
This is now a normal 1-of-2 multisig operation and will execute if Alice or Bob provides a valid signatures to their pub key.