First thing to keep in mind is a child process is returned 0 if it is created successfully. It return a +ve value to parent . Now,after the first fork() .Parent P first child C1 will be created. Now, after 2nd fork() parent P and C1 make again 2 children let them be C2 and C3 respectively. Now, C2 will return +ve value to P .So,Child C2 don;t continue further as && condition become false(returned 0). But Parent P will go on to 3rd fork(). It will create another child let it be C4.
Now,coming to C1 , now C3 will return +ve value to it's parent which is C1,So,c3 will stop here (0 is returned to child). Now,C1 will execute further and split into new child C5.
So,now there are no more forks .So, 5 child were created.