The Prophet (p) set out to Waddan to confront the Quraysh.
(THE RAID ON WADDAN WHICH WAS HIS FIRST RAID)
Until he reached Waddan, which is the raid of al-Abwa, making for Quraysh and B. Damra b. Bakr b. Abdu Manat b. Kinana. The B. Damra there made peace with him through their leader Makhshi b. Amr al-Damri. Then he returned to Medina without meeting war and remained there for the rest of Safar and the beginning of Rabi’u’l-awwal. 
In Safar (which began August 4, 623), nearly twelve months after his arrival in Medina on the twelfth of Rabi’ al-Awwal, he went out on a raid as far as Waddan, searching for Quraysh and the Banu Damrah b. Bakr b. Abd Manat b. Kinanah.
This was the expedition of al-Abwa, in the course of which the Banu Damrah made a treaty of friendship with him; their fellow-tribesman and chief, Makhshi b. Amr, acted on their behalf. Then the Messenger of God returned to Medina without any fighting, and remained there for the rest of Safar and the beginning of Rabi al-Awwal. 
Muhammed (p) having found no Quraysh there, he made peace treaties with the tribes there on condition that they would not fight him nor aid his enemies against the Muslims (Ibn Sa’d).
It is claimed by some that the Prophet (p) set out solely on this expedition in order to attack Quraysh’s caravan. However, reading the above reports, there is no mention of raiding any caravan(s). Another source which collaborates with the above reports, but details are slightly different:
“The Prophet passed by me at a place called Al-Abwa or Waddan, and was asked whether it was permissible to attack the pagan warriors at night with the probability of exposing their women and children to danger. The Prophet replied, “They (i.e. women and children) are from them (i.e. pagans). …” (Sahih al-Bukhari, volume 4, Book 52, Number 256)
As we read the three above sources it is quite clear that the Prophet’s (p) intention and aim was to attack the enemy, the Quraysh who had persecuted and murdered Muslims continually. Even if the intention was to look for Quraysh’s caravan (which is not true), we have to remember that the Quraysh robbed many of the Muslims livelihood and property (read more here: ‘Property Of Muslims Stolen – Robbed By Quraysh In Makkah?‘). They were only regaining what was theirs in the first place.
The latter part of the above Hadith needs clarifying. What did the Prophet (p) mean when he told his companions that one can attack the enemy even if women and children would be in danger? Did the Prophet (p) give permission to kill non-combatants? No!
Some misguided critics have used this report that Muslims were giving permission to kill women and children, since ‘they’re from them’ i.e., part of the enemy. All scholars agree that the Hadith did not give his companions permission to kill woman and children, this is simply not true.
What the report’s intended meaning is, that if in the process of attacking the enemy in night, children and woman did get killed UNINTENTIONALLY then it is not their fault. This is what scholars of the past have stated – from Bulugh Al-Maram footnote 383:
383 – It is not meant that women and children are killed intentionally, but if they were killed by accident then the Messenger of Allah means they are not to be blamed. (Bulugh Al-Maram, compiled and referenced by Imam Ibn Hajr, page 476)
Ibn Hajar al-Asqalani’s (1372 – 1449 CE) words:
“It does NOT mean deliberately killing them, rather, it means that if they could absolutely not be avoided and would get killed in a raid.” (Fath al-Bari, by Ibn Hajar al-Asqalani, volume 6, page 147)
Imam An-Nawawi Ash-Shafi’i (1233 – 1277 CE) also states:
والمراد إذا لم يتعمدوا من غير ضرورة, وأما الحديث السابق في النهي عن قتل النساء والصبيان فالمراد به إذا تميزوا
“What this means is that if it happens accidentally and not intentionally. The Ahadith about the prohibition on killing women and children are talking about deliberatly killing them.” (Sharh Sahih Muslim, by Imam Nawawi, volume 12, page 49)
Imam an-Nawawi goes further elsewhere:
“The scholars unanimously agreed that it is forbidden to kill women and children if they do not fight.
The haadeeth reported by Abu Dawud, al-Nasaa’i and Ibn Hibbaan from the haadeeth of Rayah ibn al-Rabee ‘al-Tamimi said:
“We were with the Messenger of Allaah in a battle. He saw some people were gathered around a woman who had been killed so he said: “This is not one with whom fighting should have taken place.” (Sharh al-Nawawi `ala Muslim — hadeeth no. 1744)
As matter of fact, the Prophet (p) always commanded his companions never to kill women and children, this is reported in many authentic Hadith:
Narrated `Abdullah: During some of the Ghazawat of the Prophet a woman was found killed. Allah’s Messenger disapproved the killing of women and children. (Sahih al-Bukhari Volume 4, Book 52, Hadith 257)
It is narrated on the authority of ‘Abdullah that a woman was found killed in one of the battles fought by the Messenger of Allah. He disapproved of the killing of women and children. (Sahih Muslim Book 19, Hadith 4319)
Sunan Ibn Majah
It was narrated from Ibn ‘Umar that the Prophet saw a woman who had been killed on the road, and he forbade killing women and children. (Sunan Ibn Majah, volume 4, Book 24, Hadith 2841)
Ibn ‘Umar (RAA) narrated that The Messenger of Allah saw a woman who was killed in one of his expeditions, so he disapproved the killing of women and children. Agreed upon. (Bulugh al-Maram Book 11, Hadith 1313)
Sunan Abi Dawud:
‘Abd Allaah bin (mas’ud) said “A woman was found slain in one of the battles of the Apostle of Allaah. The Apostle of Allaah forbade to kill women and children. (Sunan Abi Dawud Book 14, Hadith 2662)
Muwatta Imam Malik:
Yahya related to me from Malik from Nafi from Ibn Umar that the Messenger of Allah, may Allah bless him and grant him peace, saw the corpse of a woman who had been slain in one of the raids, and he disapproved of it and forbade the killing of women and children. (Muwatta Imam Malik Book 21, Hadith 9)
Abu Bakr Siddique, the first Caliph of Islam also urged his companions not to kill women and children:
Abu Bakr states: … “I advise you ten things: Do not kill women or children or an aged, infirm person. Do not cut down fruit-bearing trees. Do not destroy an inhabited place. Do not slaughter sheep or camels except for food. Do not burn bees and do not scatter them. Do not steal from the booty, and do not be cowardly.” (Muwatta Imam Malik Book 21, Hadith 10)
From the above reports we read that the Prophet (p) categorically forbade killing of women and children.  
Another point need addressing is, was the Prophet (p) justified in pursuing the Quraysh? Yes! One must remember when the Prophet (p) and his people were exiled to Medina to find safe sanctuary, as soon as they arrived the Quraysh, wrote letters to the inhabitants of Medina that if they don’t exile (or kill) the Muslims, they themselves will come there and slaughter everyone:
Kitab al-Maghazi – Ma’mar Ibn Rashid:
“The infidel Quraish wrote wrote to Abdullah ibn Ubayy ibn Salul and also to those members of the Aws and Khazraj tribes who were idolaters. This occurred while the Messenger of God resided in Medina but before the incident at Badr. The Infidel Quraish said,
“You have given shelter to our tribes men, and you remain the more numerous of Medina’s inhabitants. We swear by God that you had better either kill him or expel him, or else we will rally the Arabs to help us and march against you in our full numbers, slaying your warriors and ravishing your women!” (Ma’mar ibn Rashid: The Expeditions – An Early Biography Of Muhammad, page 67)
“AbdurRahman ibn Ka’b ibn Malik reported on the authority of a man from among the companions of the Prophet (p): The infidels of the Quraysh wrote (a letter) to Ibn Ubayy and to those who worshipped idols from al-Aws and al-Khazraj, while the Apostle of Allah (p) was at that time at Medina before the battle of Badr. (They wrote):
You gave protection to our companion. We swear by Allah, you should fight him or expel him, or we shall come to you in full force, until we kill your fighters and appropriate your women.
When this (news) reached Abdullah ibn Ubayy and those who were worshippers of idols, with him they gathered together to fight the Apostle of Allah (p). When this news reached the Apostle of Allah (p), he visited them and said: The threat of the Quraysh to you has reached its end.
They cannot contrive a plot against you, greater than what you yourselves intended to harm you. Are you willing to fight your sons and brethren? When they heard this from the Prophet (p), they scattered. …” (Abu Dawud Book 19, Hadith 2998)
From this we gather that the Muslims were only pursuing the Quraysh because of the continued hostilities and aggression by them. It was they who waged war against the Muslims first. Hence, the Muslims had no choice left but defend themselves.
Credit Discover the truth
Allah knows Best.
 Ibn Ishaq’s Sirat Rasul Allah – The Life of Muhammad Translated by A. Guillaume, page 281
 The History of al-Tabari: The Foundation of the Community: Muhammad at al-Madina, volume 7, page 12
 the Prophet Muhammed forbade the Companions with very harsh words from killing the children of non-Muslims, and repeated his prohibition many times:
“Aswad b. Sariʿ said, We were once in a battle and gained the upper hand and killed many of the pagans, including some children. News of this reached the Messenger of God and he said, “What is wrong with some people that they went so far as to kill children? Beware! Do not kill children at all! Beware! Do not kill children at all!” Someone asked, “Why, O Messenger of God? Are they not the children of the pagans?” He replied, “Are the best amongst you not from the children of pagans?”’ (al-Darimi in al-Sunan, volume 2, page 294. See also al-Ḥakim in al-Mustadrak, volume 2: page 133 – 134)
 In another narration it reads: ‘A man said, “O Messenger of God! They are only the children of the pagans!” He replied,
“The best of you are children of pagans. Beware! Children must not be killed”.’ (Musnad Ahmad, by Aḥmad Ibn Ḥanbal, volume 3, page 435. See also al-Sunan al-kubra, by al-Bayhaqi, volume 9, page 77)
 Regarding the prohibition of killing non-Muslim women, children and the elderly during war, the respected Ḥanafi jurist, Imam al-Sarakhsi, wrote in his magnum opus, al-Mabsaṭ the following:
“The Prophet said, ‘Do not kill children [walid]’. In the [Arabic] language, the word walid means one who is born [mawlud]; and every human being [adami] is born; however, customarily this word is only used for young children. Therefore, in it is proof that it is impermissible to kill the young children amongst them [the non-Muslims], as long as they are not fighting. It is mentioned in a hadith that the Prophet forbade the killing of women and children, and said, ‘Kill the [warring] elders of the pagans [during the state of war] and keep alive their subordinates’. What is meant by ‘elders’ are the adults amongst them, and what is meant by ‘subordinates’ are their followers amongst the young and the womenfolk. To ‘keep alive’ here means to take them as captives. God says, ‘And they kept their women alive’. (Qur’an 40:25) And it is mentioned in Abu Bakr’s g dictated commands to Yazid b. Abi Sufyan: ‘Kill neither a feeble old man nor a fragile young child’; in other words, an elderly man and young child do not fight.” (al-Mabsūṭ, by al-Sarakhsi, volume 10, page 5 – 6)
 Another report:
“Abu Thalaba said, ‘The Messenger of God prohibited the murder of women and children’.” (al-Ṭabarani in al-Mu’jam Al-Awsat, volume 7, page 113)