A true believer cannot be possessed by a demon because the Holy Spirit cannot inhabit the same temple as an evil spirit:
"What? Know ye not that your body is the temple of the Holy Ghost which is in you, which ye have of God, and ye are not your own? For ye are bought with a price: Therefore glorify God in your body, and in your spirit, which are God's." --1 Corinthians 6:19-20
When you belong to God and are filled with the Holy Spirit, you cannot belong to satan and be filled with his spirits at the same time. The Holy Ghost will not abide in the same "temple" with satan.
But this does not mean believers cannot be affected by demonic powers. It is these powers against which we wrestle. Satan uses demonic powers to attack believers from the outside through oppression, the symptoms of which were previously discussed. But he cannot possess the true believer. To "possess" indicates inside occupation. To "oppress" or bind indicates control from the outside.
Believers' conduct can be satanically directed if they allow demonic powers to oppress them. Such oppression or binding by evil powers permits satan to use them for evil purposes.
This is what happened when Peter, a disciple of Jesus, was used by satan to try to divert Jesus from suffering for the sins of all mankind. When Jesus described the suffering He was to go through, Peter said:
"...Be it far from thee, Lord: this shall not be unto thee." --Matthew 16:22
Jesus said to Peter:
"...Get thee behind me, satan: thou art an offence unto me: for thou savourest not the things that be of God, but those that be of men." --Matthew 16:23
Jesus did not mean Peter was actually satan. He recognized that at that moment Peter allowed satan to operate through him. He was not demon-possessed, but he was allowing satanic spirits to influence him.
Believers - by their own actions - can "give place" or make room for satan to use them (Ephesians 4:27).
When a person is born again, his name is written in a special book in Heaven called the Book of Life. Only those whose names are in this book will be residents of Heaven for eternity:
"And whosoever was not found written in the book of life was cast into the lake of fire." --Revelation 20:15
It is possible to have your name written in the Book of Life, but later blotted out because of turning back to sinful living:
"He that overcometh, the same shall be clothed in white raiment; and I will not blot out his name out of the book of life, but I will confess his name before my Father, and before His angels." --Revelation 3:5
If a believer continues in known, unconfessed sin, there is a point at which he can cease to be a Christian. The Apostle Paul expressed his own concern that he not be "cast away" after preaching to others:
"But I keep under my body, and bring it into subjection: lest that by any means, when I have preached to others, I myself should be a castaway." --1 Corinthians 9:27
Paul realized that sin, especially continued unconfessed sins of the flesh, could result in the loss of his own soul even though he preached to others.
By continuing to live in sin you will eventually end up in a backslidden condition and you will no longer be a true follower of Jesus Christ. If you continue in known and unconfessed sin, no one can tell you at what point you cease to become a follower of Jesus and again become part of satan's domain. It is God that determines that point. But when it does occur, you open yourself up to greater attacks of the enemy, including the possibility of demon-possession.
This is why it is important that when you sin, you immediately confess your sin and turn from unrighteousness:
"If we confess our sins, He is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness. If we say that we have not sinned, we make Him a liar, and His Word is not in us." --1 John 1:9-10
Jesus is called the Word of God in many places in Scripture. If the Word of God does not dwell in you, then Jesus does not dwell in you.