'Tot ziens' is used when you will/hope to see each other again, kind of like 'see you'. 'Dag' is more used as the English 'goodbye' you greet someone in a general way, not necessarily with the intention to see him/her again (imagine leaving a shop you don't visit very often and saying goodbye to the employee behind the counter). Of course you can use it with your friends/family too, there is just a slight difference between 'tot ziens' and 'dag'.
The actual correct spelling is good-bye, but most people (and the language itself) omit the hyphen between the two words, shortening it to goodbye. So goodbye is sort of correct (but accepted spelling), good-bye is the most correct, and good, bye, would be used to finish an affirmation. For example: Everything is in order? Good! Bye! Hope that helps, English can be silly at times!
Tot = till and ZIENS = WILL SEEl (future (old dutch)) so all together it translates as: TILL WILL SEE but because that is not a correct English sentence, it would be: TIIL (I/WE) WILL SEE (YOU) (AGAIN), but because that sentence (till we will see you again) , is too long in english, it is shortened to: see you. :)