When glass is rubbed with a dry cloth, the friction creates charged static electricity; this in turn attracts small non charged particles of dust. The simplest way to put it, the dry cloth creates a static charge that attracts non charged dust particles.