If you’re confused: Birds are dinosaurs, crocodiles aren’t; note the “closest living relatives”
I actually just learned this recently, but dinosaurs differ from reptiles in that dinosaurs have legs that are under their bodies whereas reptiles have legs that splay out to the side. So all mammals, and birds, with legs directly under their bodies are probably more closely related to dinosaurs then reptiles.
No. Tetrapods and reptiles diverge well before dinosaurs. All dinosaurs are diapsids as compared to mammals, which are synapsids. A dimetrodon (the one with the big sail) is not actually a dino and is more closely related to humans than it is to dinos.
To expand on this concept, all dinosaurs and humans are technically considered bony-fishes as they are nested within the bony-fishes clade, osteoicthyes, but thats probably spelled wrong (this recently was used as a way of protecting some types of animals in a law that is supposed to protect fish as a category), and all birds are technically dinos, so when we refer to non-avian dinos, it just means dinosaurs excluding the birds!