Complex Terms of Appointment
The terms of your appointment are quite complex and perhaps unnecessarily so. (I hope the mistakes in the letter are typing errors on your part.) They have a notice period of 2 months, but only after you are confirmed (you have a letter that your probation is over and confirmed with the company). They can still terminate without notice for a number of reasons listed.
Termination on Non-Performance
Termination on account of non-performance without notice is a rare clause. I am not sure if it will stand scrutiny in court. However, if it does, then of course, the management must have performance parameters and reasons why they consider you have failed. Simply because you have worked for 1.6 years is not proof that your performance was good. If you joined as a fresher, they would not consider you as productive for the first 6 months anyway. Thereafter, they would try to get you to fall in line with company standards. If you fail, then they will give up somewhere after a year, which seems to fit the pattern here.
I don't know whether your supervisor has been prompting you to improve, correct mistakes, or meet coding standards, etc. Furthermore, you have not said whether they have given anything in writing on that front or whether it was all oral. If there is evidence that they were happy with the work.
Legal Actions and Considerations
Now, whether they were fair or unfair is of little consequence in the larger picture of your career.
1. If evidence is there, you can approach a labor officer and file a complaint.
2. If evidence is in your official email, it's tougher but can still be done (a labor officer can ask for a copy of emails in your account).
3. If no evidence exists, you can still complain, and then the company will have to give their side of the story and evidence (which they can easily create).
More importantly, can you spend time fighting the company? Equally important, do you want to fight, considering that any job you take up may do a reference check with the employer?
At best, you are going to get 2 months' salary. Are you willing to accept a "Termination" letter in exchange? That is considered a major negative by most HR Departments.
Considering all that, it would make sense to resign and get a clean exit. However, do negotiate with them to see if they will give you part of the notice pay. Which path to follow you need to decide depending on various circumstances and weighing probabilities that we cannot do for you as we will not have the full details. However, I would not favor giving a resignation letter without being clear that the company will give you a clean exit (definitely offer to complete a 2-month notice period).