At the end of chapter seven, it says “The water prevailed upon the earth one hundred and fifty days.” (Genesis 7:24) The phrase “the water prevailed” means that the water was winning the battle against the earth. Now, remember that it only rained for forty days (March 27th). So, the other 120 days of prevailing must have been coming from the fountains of the deep.
Then “God remembered Noah and all the beasts and all the cattle that were with him in the ark; and God caused a wind to pass over the earth, and the water subsided.” (Genesis 8:1) The ark came to rest after five months (July 17th) .
However, they didnt’ get out right away. Remember, this is a gigantic boat. It would come to rest by being beached in 30-40 feet of water. And, this happened on a mountain (somewhere in the mountains of Ararat, probably in what is Iran or Turkey now.)
It would take another three months (October 1st) for the tops of those mountains to become visible. Ten days later (October 11), Noah sent out a dove to see what would happen. The dove flew around, but couldn’t find a place to land, so it came back to Noah. Despite being able to see the mountain tops, the planet was still covered with water.
After another week (October 18th), he sent out the dove again. This time, it came back with a freshly picked olive leave. To this day, a bird carrying an olive branch implies peace. This was God’s way of saying He was done flooding the earth.
After another week (October 25th), he sent out the dove again, but this time it didn’t come back. Presumably he also released the other dove, or we wouldn’t have doves any more. 🙂
But, dry enough for a bird isn’t good enough for humans who can’t fly. It wasn’t until January 1st that Noah takes off the covering of the ark. The surface of the earth was dried up.
I imagine they tried at this point to test the ground. Apparently it was still soggy, because they didn’t leave the ark until February 27. When they finally leave, all the animals leave with them.