What is the marrying age for men and women in the Shariah? Can any couple marry each other who had sexual relation before marriage?
Islam has not prescribed an age limit for marriage. Islam however, directs the Muslims to follow the tradition set by the humans themselves in the light of the innate guidance provided to them, and the practice of the Prophets and Messengers which requires that only adult male and female should enter the marriage bond. By adulthood in this context we mean mental and physical maturity.
Islam does not forbid two fornicators to marry each other. If the crime has not been exposed and brought to the court which sentences them to prescribed punishment and they realize that they committed serious crime and turn to their God in repentance they can marry any believing person. For the matter is not before the society and they have been granted the opportunity to correct themselves and repent. If they have the chance to marry each other that would be best.
However, if the case is brought before the court and they have been sentenced then they can again marry each other for God has prohibited such criminals from marrying chaste partners and allows them only to marry each other. Study the following verse:
The male fornicator shall not marry any but a female fornicator or idolatress, and as for the female fornicator, none shall marry her but a male fornicator or an idolater; and it is forbidden to the believers. (24:3