Are there pawns on the board? If so, how many and where are they placed? That makes a big difference whenever trying to answer these types of questions regarding which piece (or pieces) is better than another piece (or pieces).
which is better? 2 knights or 1 rook?
With pawns NN > R. The NN can attack a pawn twice, while the rook can defend only once. On the other hand a R without pawns can checkmate, while NN cannot checkmate without a pawn.

Two pieces tend to be better than one.
Long range pieces tend to be better than short range.
And of course active pieces are better than inactive

I think 2 knights, but it depend on the position. If you have king and 2 knights vs king that would be a draw. But usually 2 pieces can cooperate better than one.
1 rook because there are several directions where the rook cant capture the knight but you have to get your rook into a position where it can get both to win this duel. the king would also be a major factor since this is probably assuming that it's just 1 rook + 1 king against 2 knights + 1 king

I would guess that it depends on where they are placed, if the knights are far away I would say the rook is better
if the knights are in close proximity with each other I would say the knights are better
With pawns NN > R. The NN can attack a pawn twice, while the rook can defend only once. On the other hand a R without pawns can checkmate, while NN cannot checkmate without a pawn.
A rook v two knights theoretically wins only 3.2% of rook v. 2 knights positions according to https://syzygy-tables.info/ (still a lot more than the knights - 0.0% to 1 d.p.). But NN can checkmate without a pawn e.g.

a R without pawns can checkmate, while NN cannot checkmate without a pawn.
But pawnless R vs N is a draw, so saying a rook can mate in a pawnless R vs NN is silly.
In fact pawnless Q vs NN is a draw in certain situations
-
-
Looking at this from a pawn vs pawnless perspective is not very useful, except maybe to say that like many endgames, once you go to pawnless it's either very hard or impossible to win.
a R without pawns can checkmate, while NN cannot checkmate without a pawn.
But pawnless R vs N is a draw, so saying a rook can mate in a pawnless R vs NN is silly.
In fact pawnless Q vs NN is a draw in certain situations
-
-
(Also two knights vs a lone king can checkmate, it's just not a forced mate. Therefore it's easy to imagine that two knights can mate a king + rook)
But the rook can checkmate sometimes (3.2%).
This turns into a pawnless R v N on move 9.
Agreed. It's still only one position in thirty.
But I think between equally strong players that can't consult a tablebase the result in the position I posted would be a draw anyway. (Certainly would if I were playing Black.)

There isnt a single right answer because it all depends on the position. If you had to pick what to play with at the beginning up a rook or two knights, if you are a good player, two knights would be much better. Same thing applies to complicated middlegames when there are couple of pawns left. But when it comes to the endgame two knights + king without any pawns are useless and cant be compared with rook + king without any pawns on the board. Reason is simple, first one can't force a mate and second one is 100% winning. I hope this helps. :)
... But when it comes to the endgame two knights + king without any pawns are useless and cant be compared with rook + king without any pawns on the board. Reason is simple, first one can't force a mate and second one is 100% winning. I hope this helps.
Except second is hardly ever winning. (Not even if it's a theoretical win. Try playing the position in #10 as Black against a tablebase.)

Guys... stop mentioning that two knights can't mate...
The question isn't "is it better to be ahead by a rook or to be ahead by two knights"
That's not the question because it's a stupid question. You're completely winning either way.
The question is that one player has a rook, and the other player has two knights.
hi everyone this is sachin. and yes by seeing the forum you can get it for what we are gonna discuss for. it is knights vs rook. i have never experienced this position in any of my chess career games. i even experienced 2 bishops and a rook. but not with knights tho. so if you dont mind could you all pls try to make me clarify at this doubt?
thanks in advance!,
Regards,
Sachin.