I have a 2002 E39 BMW.
The car gives a rattling noise when rolling at low rpm with the clutch engaged in any gear.
The noise goes away if I add a little gas or depress the clutch any idea what could be causing this?
Sounds like it's possibly involved with the transmission and/or clutch.
But first, I would check all the heat shielding on the car to make sure that's not a factor. When the transmission is engaged (when the clutch is not depressed) it can cause some NVH (noise, vibration, harshness) that will cause nearby heat shields to rattle and make it sound like a transmission problem. Once you've confirmed your Catalytic converter or exhaust heat shields are secured and/or not rattling, there are a few things that could be the case.
The important thing is to isolate the sound to exactly your transmission. Loose heatshields and other motive parts can cause sounds and NVH can make it sound like it's coming from a different location.
The noise goes away if I add a little gas or depress the clutch
This is a classic symptom of a bad throwout bearing.