First off, you need to determine exactly where the sound is coming from. To do this, use a stick or a long screwdriver as a listening probe. Very simple, put the probe on the engine, cup the other end of it with your hand, and put your ear in your hand so you can hear the sounds transmitted by the probe. Move it around until the sound gets louder. Just don't put it somewhere near the belt so that it gets caught up and causes some damage to you or the car.
There are too many causes of a rattling sound for someone, especially online, to just point out the problem without testing. It could be a motor mount, it could be something inside the engine, it could be bearings in an idler pulley, it could be the AC clutch or compressor shaft- who can be sure? All of those that posted the "same" problem could very well have completely different problems which all make sounds that are defined as as a rattle.