Your sentence #2 is not grammatically correct. We would say "I have not been there in three years." (You will notice that both of the examples on the web page use the present perfect, not the simple past.)
for refers to the span of time at any point - that is, any three years. in refers to the most recent span of time, like the most recent span of time.
If you want to make a negative version of sentence #1, you would say "I was not there for three years." (That is, maybe you were there for one year, or for five years, but not three years.)
If you say "I have not been there in three years" it means "I have not been there during the most recent three years."