Termination from work on the 40th day by the Employer

Need Help, I joined a private company on 2nd Oct 2017 and i was put through a training and when i was in training i reported to my team leader that training was happening properly. I was on training and got a change to work on live assignment for about 7-10 days only. On 30th Oct 2017 which was on the 29th day of my employment my manager called me and told me that the management is not satisfied with my performance on no grounds ( no assessment was taken) and told me that i will be moving to the other process of different job roll. i was in my new job roll for just 10 days and learned the process of work. On 9th Nov the management called me for an assessment and the questions asked was not related to my current process but from the previous process from where i was moved to a different team and the questions were asked not based on the training provided, most of the question were asked in jargons of short form. when i told them these was not taught to me in my training they gave the answer as : "you should have learned from google" On 10th Nov they again said they are not satisfied with my performance and told me today would your last day of working My manager was asking me to send an email to him stating that i am resigning else he will terminate me. I denied to send resignation email to him. NOW as per my employment contract: it is written as below At the time of separation, either party may terminate this contract of employment by giving to the other party, two months written notice or payment of two month's gross salary in lieu of notice. the XYZ Pvt Ltd reserves the right to pay or recover salary in lieu of notice period. Please help me, was that right for they to terminate only with 40 days employment stating my performance was poor. will they make a reason not to pay me 2 months salary stating my performance was poor Please help