The principle of distinction and protection of civilians is only found in thin allusions in treaties (I), but to some extent in the scholary treatment of international law (II) and in the national martial laws (III). But we should not think of the recognition of the principle of disctinction in too modern ways (IV).
I. Allusions in international treaties
There is no clear recognition of special rules on civilians in the important international treaties of that time. The treaties ending the Thirty Years War and the War of the Spanish Succession contain only allusions of such rules for special cases:
- The Peace of Westphalia 1648, Art. XVII, 9 IPO = § 118 IPM (English translation of 1710, ibid.)
Quoties autem milites quavis occasione aut quocunque tempore per aliorum territoria aut fines aliquis ducere velit, transitus huiusmodi instituatur eius, ad quem transeuntes milites pertinent, sumptu atque adeo sine maleficio, damno et noxa eorum, quorum per territoria ducuntur, ac denique omnino observentur, quae de conservatione pacis publicae Imperii constitutiones decernunt et ordinant.
And as often as any would march Troops thro the other's Territorys, this Passage shall be done at the charge of him whom the Troops belong to, and that without burdening or doing any harm or damage to those whose Countrys they march thro. In a word, all that the Imperial Constitutions determine and ordain touching the Preservation of the publick Peace, shall be strictly observ'd.
This guarantee of peacfull walk through also helps the population of these territorys, but the right holder is the prince of this territory, he is protected.
However, in case (which God Almighty forbid) the dissensions which have been laid asleep should at any time be renewed, between their said Royal Majesties, or their successors, and break out into open war, the ships, merchandizes, and all the effects, both moveable and immoveable, on both sides, which shall be found to be and remain in the ports, and in the dominions of the adverse party, shall not, be confiscated, or any wise endamaged; but the entire space of fix months, to be reckoned from the day of the rupture, shall be allowed to the said subjects of each of their Royal Majesties, in which they may sell the aforesaid things, or any part else of their effect, or carry and remove them from thence whither they please, without any molestation, and retire from thence themselves.
So the civilians in the territory of the enemy are protected, but not the ones in their own territory when it was conquered. This also seems to be a special provisons for both parties, not a recognition of a overarching rule.
II. Scholary opinions
The most important scholars in international law of the 17th and 18th century Hugo Grotius (1583-1645) and Emer de Vattel (1714-1767) agreed at large that civil subjects of the enemy are enemies. Grotius says they are lawful to kill, but it is just and laudable to spare them as far as possible. De Vattel binds the lawfulness of the killing to the military necessity, that is normally not given for civilians, but sees the exemption of mistreatment only as an act of mercy. Both exclude mans that can be made to soldiers from this benefits. None of them mention any treaties on that topic whereas they both give antique and de Vattel also modern examples in their whole work.
I concentrate here on killing civilians for sake of length of this answer. Other behaviours and prisioners of war would give at least the same amount of material.
Hugo Grotius: De jure belli ac pacis. 1625
(English translation: The Rights of War and Peace, edited and with an Introduction by Richard Tuck, from the Edition by Jean Barbeyrac (Indianapolis: Liberty Fund, 2005))
After detailed explanation that "lawful" does not mean it is just or recommended, he comes to conclusion that anyone of the subjects of the enemy can be lawfuly killed.
book III, chapter IV, n. III. Therefore in this Sense it is lawful for one Enemy to hurt another, both in Person and Goods, not only for him that makes War on a just Account, and does it within those Bounds which are prescribed by the Law of Nature, as we have saida in the beginning of this Book, but on both Sides, and without Distinction; so that he cannot be punished as a Murderer, or a Thief, tho’ he be taken in another Prince’s Dominion, neither can any other make War upon him barely upon this Account. And in this Sense we are to take Sallust, By the Laws of War all Things are lawful to the Conqueror.
book III, chapter IV, n. VI. But this Right of Licence is of a large Extent, for it reaches not only those who are actually in Arms, and the Subjects of the Prince engaged in War, but also all those who reside within his Territories; [...] And without doubt Strangers, that come into an Enemy’s Country after a War is proclaimed, and begun, are liable to be treated as Enemies.
But he also says that one shall "moderate" the killing in the war. Even if it is lawful it is not in any case just.
book III, chapter X, n. I. 1. I must now reflect, and take away from those that make War almost all the Rights, which I may seem to have granted them; which yet in Reality I have not. For when I first undertook to explain this Part of the Law of Nations, I then declared, that many Things are said to be of Right and lawful, because they escape Punishment, and partly because Courts of Justice have given them their Authority, tho’ they are contrary to the Rules, either of Justice properly so called, or of other Vertues, or at least those, who abstain from such Things, act in a manner more honest and more commendable in the Opinion of good Men.
book III, chapter XI, n. IX. 1. These general Principles being laid down, it will not be difficult to infer more particular Rules. Tender Age must excuse the Child, and her Sex the Woman, (says Seneca, in his Books against Anger). [...]
book III, chapter XI, n. IX 4. Valerius Maximus calls the Behaviour of Munatius Flaccus against Women and Children, a barbarous Cruelty, and not fit to be mentioned; Diodorus tells us, that the Carthaginians, at Selinus, killed old Men, Women, and Children, without any Manner of Compassion. And in another Place he calls this Act a savage Cruelty. Latinus Pacatus stiled Women, A Sex which the Wars spare. And so did Statius of old Men.
Nullis violabilis armis
Old Men should be from Violence secur’d.
book III, chapter XI, n. X. 1. What we have said (of Women and Children) may be generally said of all Men, whose Manner of Life is wholly averse to Arms. [..]
book III, chapter XI, n. X. 2. They also have justly this same Privilege, as the Priests, who have embraced a like Sort of Life, as Monks, and Lay-Brothers, that is, Penitents, whom the Ecclesiastical Canons, according to natural Equity, would have spared equally as Priests. To these we may justly add those who apply themselves to the Study of Sciences and Arts beneficial to Mankind.
book III, chapter XI, n. XI. Next to these, the Canons privilege Husbandmen. [...]
book III, chapter XI, n. XII. Next to these the Canon includes Merchants, which is not to be understood only of those who sojourn for a Time in an Enemy’s Country, but also such as are natural and perpetual Subjects, because the manner of the Life they use is entirely averse from War: And under this Denomination are comprehended all Sorts of Mechanicks and Tradesmen, whose immediate Interest makes them more inclinable to Peace than War.
Emer de Vattel: Le droit des gens. 1758
(English translation: The Law of Nations: Or, Principles of the Law of Nature Applied to the Conduct and Affairs of Nations and Sovereigns. 6th ed. 1844. Philadelphia: T. & J. W. Johnson (edition of 1797 with later comments of de Vattel))
De Vattel in principle gives the parties of a war the right to do anything they hold for necessary to weaken the enemy.
chapter VII, § 138. Since the object of a just war is to repress injustice and violence, and forcibly to compel him who is deaf to the voice of justice, we have a right to put in practice, against the enemy, every measure that is necessary in order to weaken him, and disable him from resisting us and supporting his injustice: and we may choose such methods as are the most efficacious and best calculated to altam the end III view, provided they be not of an odious kind, nor unjustifiable in themselves, and prohibited by the law of nat
But this is also the limit of the lawful. And it is never necessary to directly kill (most) civilians. But if a general sees an advantage in treeting them badly he may do so. He sees that this was seldom seen as necessary in the last time. § 147 is also the text cited by OP's source.
chapter VIII, § 145. Women, children, feeble old men, and sick persons, come under the description of enemies (§§ 70-72); and we have certain rights over them, inasmuch as they belong to the nation with whom we are at War, and as, between nation and nation, all rights and pretensions affect the body of the society, together with all its members (Book II §§ 81, 82-344). But these are enemies who make no resistance; and consequently we have no right to maltreat their persons, or use any violence against them, much less take away their lives (§ 140). This is so plam a maxim of justice and humanity, that at present every nation, in the least degree civilized, acquiesces in it. If, sometimes. the furious and ungovernable soldier carries his brutality so far as to violate female chastIty, or to massacre women, children, and old men, the officers lament those excesses: they exert their utmost efforts to put a stop to them; and a prudent and humane general even punishes them whenever he can. But, if the women wish to be spared altogether, they must confine th~mselves to the occupations peculiar to their own sex, and not meddle with those of men, by taking up arms. Accordingly, the military law of the Switzers, which forbids the soldier to maltreat women, exceps those females who have committed any acts of hostility.
§ 146. The like may be Baill of the public ministers of religion, of men of letters, and. other persons whose mode of life is very remote from military affair: - not that these people, nor even the ministers of the altar, are, necessarily and by virtue of their functions, invested with any character of inviolability, or that tbe civil law can confer it on them with respect to the enemy: but, as they do not use force or violence to oppose him, they do not give him a right to use it against them. Among the ancient Romans the priests carried arms: Julius Cresar himself was sovereign pontiff: - and, among the Christians, it has been no rare thing to see prelates, bishops, and cardinals, buckle on their armor, and take the command of armies. From the instant of their doing so, they subjected themselves to the common fate of military men. While dealing out their blows in the field of battle, they did not, it is to be presumed, lay claim to inviolability.
§ 147. Formerly, everyone capable of carrying arms became a soldier when his nation was at war, and especially when it was attacked. Grotius, however, produces instances of several nations and eminent commanders who spared the peasantry in consideration of the immediate usefulness of their labours. At present, war is carried on by regular troops: the people, the peasants, the citizens, take no part in it, and generally have nothing to fear from the sword of the enemy. Provided the inhabitants submit to him who is master of the country, pay the contributions imposed, and refrain from all hostilities, they live in as perfect safety as if they were friends: they even continue in possession of what belongs to them: the country people come freely to the camp to sell their provisions, and are protected, as far as possible, from the calamities of war. A laudable custom; truly worthy of those nations who value themselves on their humanity, and advantageous even to the enemy who acts with such moderation. By protecting the unarmed inhabitants, keeping the soldiery under strict discipline, and preserving the country, a general procures an easy subsistence for his army, and avoids many evils and dangers. If he has any reason to mistrust the peasantry and the inhabitants of the towns, he has a right to disarm them, and require hostages from them: and those who wish to avoid the calamities of war, must submit to the laws which the enemy thinks proper to impose on them.
§ 148. But all those enemies thus subdued or disarmed, whom the principles of humanity oblige him to spare, - all those persons belonging to the opposite party, (even the women and children), he may lawfully secure and make prisoners, either with a view to prevent them from taking up arms again, or for tbe purpose of weakening the enemy (§ 138), or, finally, in hopes that, by getting into his power some woman or child for whom the sovereign has an affection, he may induce him to accede to equitable conditions of peace, for the sake of redeeming those valuable pledges. At present, indeed, this last-mentioned expedient is seldom put in practice by the polished nations of Europe: women and children are suffered to enjoy perfect security, and allowed permission to withdraw wherever they please. But this moderation, this politeness, though undoubtedly commendable, is not in itself absolutely obligatory; and if a general thinks fit to supersede it, he cannot be justly accused of violating the laws of war. He is at liberty to adopt such measures in this respect, as he thinks most conducive to the success of his affairs. If without reason, and from mere caprice, he refuses to indulge women with this liberty, he will be taxed with harshness and brutality, - he will be censured for not conforming to a custom established by humanity: but he may have good reasons for disregarding, in this particular, the rules of politeness, and even the suggestions of pity. If there are hopes of reducing by famine a strong place, of which it is very important to gain possession, the useless mouths are not permitted to come out. And in this there is nothing which is not authorised by the laws of war. Some great men, however, have, on occasions of this nature, carried their compassion so far as to postpone their interests to the motions of humanity. We have already mentioned, in another place, how Henry the Great acted during the siege of Paris. To such a noble example let us add that of Titus at the siege of Jerusalem: at first he was inclined to drive back into the city great numbers of starving wretches, who came out of it; but he could not withstand the compassion which such a sight raised in him; and he suffered the sentiments of humanity and generosity to prevail over the maxims of war.
III. National martial laws
King Gustav II Adolf of Sweden (1611-1632) reformed the Swedish military. Among ofther things he decreed a martial law and "Artikelbrief" (the norms for the mercenary soldiers) regulating the behavior of the soldiers (German print of 1632). This law was (according to German Wikipedia) togethter with its model the Articulsbrief of the States General of the Netherlands model for many other martial laws in Germany and England.
In this law there were some norms protecting civilists:
tit. XVI, § 69: prohibits rape by sentence of death.
tit. XVIII, § 77: prohibits arson ("Feuer anlegen") in town and village, esp. churches, hospitals, schools and mills; to break of a military useful house; to destroy agricultural equipment. The sentence is death.
tit. XVIII, § 78: allows arson ("Feuer einwerfen") only on clear order. I suspect the difference from § 77 is, that "Feuer einwerfen" is in the conext of a battle from distance, whereas "Feuer anlegen" is in a conquered area. The sentence is prison or death according to the military disadvantage.
tit. XVIII, §§ 79, 80: prohibits robbery and theft. Sentence is death or respectively running the gauntlet. This manly for a well-ordered supply of the army as in § 81 the death sentence is separately ruled for not delivering stolen goods from enemy territory in camp. Requisition was also a normal way to feed the army in that time.
tit. XIX, § 83: prohibits to plunder churches and hospitals of conquered towns and villages without extra order. Violation is sentenced as robbery.
tit. XIX §§ 84, 85, 86: prohibit to plunder before the enemy is completely beaten. Sentence is up to death dependent on circumstances.
But these norms had a double nature: At the one hand they protected civilians from greedy or thoughtless soldiers, at the other hand they protected military discipline so that the military goal does not get sabotaged by the selfish interests of individual sodiers. In addition also mercy for civilians had a military importance as the conquered land had to feed the army. The primate of the military interests can be seen by observing that nearly all these behaviours are allowed on clear order.
Only the prohibition of rape has a clearly humanitarian and moral target (prostitution was forbidden too, tit. XVI, § 70).
These norms were in force during the Thirty Years War known for its cruelty to civilians. Indeed the Swedish army wes more disciplined towards the population in the beginning but this ceased with time [German Wikipedia]. Whaley [Das Heilige Römische Reich Deutscher Nation, 2014, Bd. I, p. 769 (original in english)] sees a general trend to more civil deads in 1634/35 when the position for negotiations were to be improved, then in the 1620s.
The trend to distinction of civilians and soldiers in the 18th century was founded not in international treaties to humanify the war but in a desire to spare civilians - if military possible - already in the 17th century. Civilians remained enemies, but with the changed nature of the wars (Cabinet wars) it were not longer military and political helpful to attack them. But this military necessity stayed the essential principle. Only as long as it was not necessary to attack civilians there were spared. This was not only the practice but the common opinion on international law.
This distincts the "principle of distinction" in these days from the modern principle. Today the needs of the war are (officialy) not enough reason to kill civilians. The practice may differ, but so is the accepted international law.