Jesus didn't really say anything about it, the best you can say is that when he talked about marriage (which was sparsely little) he only mentioned men and women but that's not really the same as exclusion. And given the rest of what we know about Jesus he totally would have married two dudes if he had ran into a couple asking for the sacrament.
The Bible is full of examples of gender nonconformity Jacob & Esau, Deborah, Tryphaina and Tryphosa, Euhodia and Syntyche. To say look at all these women taking on male roles and men taking on female roles and it being totally fine but then saying no no you can't do that for marriage (or the priesthood) is drawing a line for no reason. A man taking the role of a wife or a woman taking the role of a husband isn't really out of line for the bible.