Atiyah-Macdonald has been the best introduction to commutative algebra from the moment it was published in 1969.
Actually I think it is one of the most extraordinary textbook ever published in all of mathematics .
It is exactly 128 pages long, hence also one of the thinnest mathematics books on the market, but contains a mind-boggling quantity of material.
It starts with the definition of a ring (!) on page 1 but already in the exercises to Chapter 1 you will find a self-contained introduction to affine algebraic geometry, both classical and scheme-theoretic (and as an aside, remember that schemes were very new in 1969).
The book calmly goes on to chapter 11, the last one, where different definitions of dimension are given but proved to be equivalent.
You will also learn in that chapter about Hilbert functions and regular local rings, two notions which play a great role in algebraic geometry.
I won't even try to summarize the other chapters: suffice it to say that every basic notion in commutative algebra is covered: the Nullstellensatz for example is proved (or given as an exercise with hints) several times.
And the most remarkable feature of the book is that every proposition is proved, crisply but completely, without cheating or resorting to hypocritical shortcuts like "it is easy to see..." or "it is left as an exercise ..."
There are other good books on commutative algebra: Bourbaki, EGA, Eisenbud, Patil-Storch, Zariski-Samuel, ... but they are probably too advanced for a beginner, whom they might discourage rather than help.
I advise you to to use them as reference books once you have studied a reasonable part of Atiyah-Macdonald.
Good luck!