For me, I follow the general rule of never elbows while actually eating food. When you stop eating, are talking with your fellow diners, or are between courses anything goes. But more importantly common sense rules. Know your setting, fellow diners, and situation. Sometimes elbows and sometimes not. But even when I am at a nice restaurant I will catch myself with my elbows on the table, look around, and realize that most diners put their elbows on the table through portions of their meal. I see nothing wrong with it.
There is really little reason for this elbow manner actually -- it is mostly likely a historical artifact of days gone by. I read that it actually may have come from communal dining long ago and putting elbows on the table would take space away from others (that makes sense). Also, there was possibly a design of a table/setting in Europe that would be tipped easily if people put elbows on it. Both of these no longer apply, but the tradition has kept on.
In some countries keeping hands under the table is not acceptable, and for most of the world, the elbows-on-the-table thing is unknown and irrelevant -- we are the minority. On the other hand, Arabs in general don't eat with their left hand, which is considered unclean. That practice was based upon personal sanitation and other factors, but in more modern (clean) Arab countries you will see people using their left hand more than in less clean places such as Yemen.