is it possible surrender mod for countries; i mean, example; if allies capture baghdad,mesopotamia, plaestine, basra, Ottoman is surrender; All Anatolian territories will going to neutral territories. Ottomans are fight off,
Not 100% possible because, aside from massive triggering, it won't work in case having allies in the territory, plus it won't work for the ships, with special reference to the issues related of having units loaded on ships of other players.
Anyway, for changing over territories from one player to another, you can look at "Empire".
then is it need more simple codes for limited surrender; i mean; example if russian product power under to 50. Russia is automatical surrender; west russia gaining to germany other russian territories will going to impossible territories;
Sounds like multiple capitols, but country is not conquered until all capitol have been conquered. The extra code to disable units would make this extremely difficult. At the same token, the feature for many capitols would have to be very useful, and preferably after a map that relied on the feature had been fully prototyped.
What you want to do is possible, but it is fairly complex to implement, so I suggest you give up, unless you manage to have a good hold on advanced triggering.
One possible way is having different units per different powers (infantry_russia etc.) and, upon meeting some conditions, triggering all units having movement 0, all territories having production 0, removing all PUs with triggers, setting relationship as being like impassable for land, etc.; so that all phases will be skipped etc..
But in order to do this you should have a good grasp on xml triggering, so maybe is something that you don't want adventure into doing, if you can't understand maps like Empire or any humbabba's.
For example, in humbabba's case, all works perfectly only because you can never enter allied territories and you can never load on allied ships; otherwise its system would not work perfectly anymore.
So, you really need to have an all around understanding of TA, before adventuring into doing such things.