What is the Roman Catholic position on the validity of the marriage between an infertile man and infertile woman? Also, from this standpoint, what is the difference between a marriage in which both partners are opposing sexes but infertile and a marriage in which both partners are the same sex?
I assume you are asking about the validity of a marriage between people who cannot conceive children. The position is summed up in this paper. To summarize:
Infertility does not prevent a person from validly entering into marriage. The Code of Canon Law affirms, “Sterility neither prohibits nor invalidates marriage” (No. 1084.3). Appreciating the suffering of an infertile couple, the Catechism states, “Spouses to whom God has not granted children can nevertheless have a conjugal life full of meaning, in both human and Christian terms. Their marriage can radiate a fruitfulness of charity, of hospitality, and of sacrifice” (No. 1654). In this case, a couple can consummate the marriage, but they just cannot conceive children.
Your last point, about marriage between partners of the same sex, is an entirely different question and I suggest you ask it separately.