Here our professor told that the degree of freedom of the system is 2 as we just need 2 angles shown in the figure to completely specify the configuration of the system but this system with a given angle can have two configurations as shown, so I think that it should have total 3 parameters and degree of freedom should be 3.
Let us name the joints in the question as A,B,C,D and E (starting from left bottom of the figure). Now since there is angle $\theta$ in each joint, so we can have Total five (non-independent) coordinates in the system. Now consider triangle ABC, in this triangle the sum of all angles at joints must be equal to $180^0$, similarly in triangles BCD and DEF.
So we have total 3 constraints in 5 coordinates. so degree of freedom is 2.
By 'degrees of freedom' we mean the number of continuous parameters needed to specify the state of the system; discrete parameters, like the binary choice you've outlined, do not count here.
Ultimately, this refers to the dimension of the manifold of the state space of the system. The two angles in your question are a sub-optimal coordinate chart for this manifold, which appears to "fold back", but there are better coordinate charts that use only two continuous parameters and don't involve the binary choice you've outlined.