Hi Ramy
Normally a rug only covers part of the floor. You can pick up a rug and move it easily. You can't do this with a carpet. Usually a carpet covers the whole floor.
You can't use the word 'rug' for anything which is permanent/not easy to move.
BUT, sometimes you can use the word carpet for things which we might also call rugs. For example a magic carpet, like the one used by Aladdin, is normally quite small and movable. And it is this type of thing - which might be called a Persian or Turkish carpet - which is sometimes a rug/sometimes a carpet.
Does that help?
Chris