The qualities that are examined in choosing a spouse are as follows:
- Religion (righteousness)
- Kind temperament
- Beauty or Attractiveness
Some of these qualities can be known by observation, such as beauty. Some by reasoning, for example fertility can be gauged from any past marriages or the reputation of the married members of their family. Some such as righteousness and interpersonal behavior can be known by making inquiries from trustworthy people such as from mutual acquaintances.
Certain qualities override others, for example religion is more important than everything else. The significance of other qualities can vary with the circumstances, for example marriage to an elder non-virgin can be preferred if there is an interest served by it.
The following are some ahadith on this topic:
تنكح النساء لأربع لمالها ولحسبها ولجمالها ولدينها فاظفر بذات الدين تربت يداك
A woman may be married for four things: Her wealth, her lineage, her beauty or for her religion. Choose the religious, may your hands be rubbed with dust (i.e., may you prosper).
— Muslim, Bukhari, Abu Dawud
قيل لرسول الله صلى الله عليه وسلم أى النساء خير قال التي تسره إذا نظر وتطيعه إذا أمر ولا تخالفه في نفسها ومالها بما يكره
It was said to the Messenger of Allah: 'Which woman is best?' He said: 'The one who makes him happy when he looks at her, obeys him when he commands her, and she does not go against his wishes with regard to herself nor her wealth.'
فآذنته فخطبها معاوية وأبو جهم وأسامة بن زيد. فقال رسول الله -صلى الله عليه وسلم- أما معاوية فرجل ترب لا مال له وأما أبو جهم فرجل ضراب للنساء ولكن أسامة بن زيد
So she let him know, and Mu'awiyah, Abu Jahm and Usamah bin Zaid proposed to her. The Messenger of Allah (sﷺ) said: "As for Mu'awiyah, he is a poor man who has no wealth. As for Abu Jahm, he is a man who beats women. But (choose) Usamah bin Zaid."
تزوجوا الولود الودود فإني مكاثر بكم
Marry the one who is fertile and loving, for I will boast of your great numbers.
— Abu Dawud and Nasai
إذا خطب أحدكم المرأة فإن استطاع أن ينظر إلى ما يدعوه إلى نكاحها فليفعل
When one of you asked a woman in marriage, if he is able to look at what will induce him to marry her, he should do so.
— Abu Dawud
عليكم بالأبكار فإنهن أعذب أفواها وأنتق أرحاما وأرضى باليسير
You should marry virgins, for their mouths are sweeter, their wombs are more prolific and they are satisfied with less.
— Ibn Majah
قال: فهلا بكرا تلاعبها؟ قلت: يا رسول الله: إن لي أخوات، فخشيت أن تدخل بيني وبينهن، قال: فذاك إذن
The Prophet said: 'Why did you not marry a virgin so you could play with her?' I said: 'I have sisters and did not want her to create trouble between them and me.' He said: 'That is better then.'
— Muslim, Bukhari etc.
Note that most of these ahadith are about qualities to look for in a wife, but by analogy the same qualities are searched for in a husband, ref: here and here.