My friend ask me to open a wallet in blockchain and ask me to give the ID and password later he transact certain amount of btc which shows non spendable after which I am asked to change my password and finished 2FA then I was asked to deposit some btc in my wallet to create a transactions history so that non spendable can be made spendable so is it a scam
Yes, it's a scam, and a well known one. You will lose all money that you deposit to that wallet, even if only you have the password and 2FA for the wallet. Your "friend" already copied the recovery seed and can take the money from the wallet even without a password or 2FA. Simply stop corresponding with that person.