I have searched around for this and found the following article In getrawtransaction, what is the vout integer in the vin list?. However I am a very visual learner and this does not make much sense mostly because the two transactions I tested don't seem to follow the rule in the post or more likely I don't get it.
For transaction 1d7f54deccb7b2646a4ba83c6884dbac953b0588c8943d0e7e8f7c8f559d5d72 I expect the vout to be 1 which is correct and I validated through use of gettxid.
However for transaction ef96555197df4397ac4fed180903ce760fe8b59b85da83baba5ecd2a0fac7ec1 I expect the vout to be 2 which is not correct per validation with gettxid. The correct number is in fact 0.
Can anyone explain this to me why vout for the second transaction would be 0?