You're right to want to understand it, because the penalties escalate quickly. Killing a teammate costs you $300 on the spot, and the kick thresholds are based on damage actually dealt after the friendly fire reduction. Bullets only do 33% damage to teammates in Premier and Competitive, but HE grenades still hit for 85%, which is why a stray nade is so much more dangerous than a stray bullet. You get a chat warning at 200 team damage in a match and an auto-kick past 300, and killing a teammate in the first five seconds of a round kicks you immediately regardless of damage. Once kicked you can't rejoin, it counts as an abandon, and the cooldown ladder runs from 30 minutes up to a week. Casual and Retakes have friendly fire completely off, so no damage and no penalty there. One tip, don't shoot back at a team killer, because your bullets go on your own damage counter too. If you want the full table of damage percentages by mode and the exact kick rules, there's a detailed breakdown here:
https://dsgamix.com/en/articles/cs2-team-kill-penalty/ . Worth a read so you don't get caught out by a spawn nade.