Hi , and welcome to the Apple (user-to-user) Community!
Re: "Can't login to AppleID to use App store":
"Your Apple account is the one account that you use to access all Apple services and make all of your devices work together seamlessly. After you log in, with your Apple ID (generally an email address ... in some countries a phone number) you can then use the App Store, iCloud, iMessage, Apple Music, Apple TV+ and more".
Re: " ... whenever I try to install anything from the App Store It tells me to log in."
You may want to check you have signed in (to your Mac) with your correct Apple ID that you want to use in the App Store : See: Sign in to your Apple Account - Apple Support
You may also want to check your Mac's MacOS software version is up-to-date:
You can see if an update is available in Apple menu > System Settings > General > Software updates.
(What's new in the updates for macOS Sequoia - Apple Support says MacOS 15.1.1)
_______________________________________________________________
Re: "I even added credit card to the account (via website) and it was ok."
I trust this was added to the one Apple Account you will use for purchases (https://appleid.apple.com)
Maybe check the card you added is a payment method that Apple can accept in your country or region:
Payment methods that you can use with your Apple Account - Apple Support
If needed: How to: Add a payment method to your Apple Account - Apple Support
You may need to allow 24 hours for updates to come into effect.
or
You may want to restart your Mac: (deletes temporary files, re-establishes connections, may update recent setting or other changes, and often restores order if something is not working as expected.)
On your Mac, choose Apple menu > Restart. Wait for Mac to restart, and log-back in with your password.
____________________________________
Re: "tells me to enter security number (3 digits)
then I enter these 3 digits I click ok and I get error "security number has to be 3 digits"
That number would be the CCV (orCVV) 3 digit number from the back of the card
Depending upon where you live, and what payment methods Apple can accept in your country:
you may need to check with the provider that the card / account / is valid for International transactions.
____________________________
Re: I cannot use App Store at all.
For the first time you use the App Store:
you need a valid payment method in your Apple account, even for free apps.
You may want to check if any restrictions on purchases are set:
Manage App Store purchases, settings, and restrictions on iPhone - Apple Support
See what to do: If you can't download or update apps on your Mac - Apple Support
If needed:
App Store Support has a website online (info. / support / contact options, etc):
App Store - Official Apple Support
All the best :-)