You can homebrew it any way you want. We are just describing the rules in the book.
---
All rogues have Hide as a bonus action at 2nd level.
Hiding in combat is a way to get advantage, reposition, flee or a myriad of other things. "You can't hide from a creature that can see you clearly". Once hidden, you have advantage on your attacks on them, they don't know what square you are in (for certain), and they have disadvantage on attacks on you (if they do manage to guess what square you are in).
Invisible is similar to hiding, except they by default know what square you are in. Hiding while invisible is easy - just take the hidden action - as the "You can't hide from a creature that can see you clearly" is an easy condition to handle. However, non-rogues still have to take an action after being invisible to become hidden, by RAW, and rogues (after level 2) have to take a bonus action.
Hiding in combat does not trigger the assassin "auto crit" feature. By the rules, you can only get surprise at the start of a combat.
It is mildly ambiguous when a creature being "surprised" ends; it is reasonable to make it "at the end of the first round of combat" or "once you finish your first turn of combat". As others have noted, if they had made "surprised" a condition, this would be much clearer.
If it was a condition, I'd write it like:
Surprised: Before combat starts some creatures are unaware hostiles are present. The DM determines if this has occurred. When surprised, you cannot take actions nor reactions; if you where walking right before combat begins, you may continue to walk in that direction on your turn. If you take your turn and there is evidence of hostile creatures (an ally takes damage, or you can see them, etc), surprise ends at the end of your turn.
Surprise: At the start of combat sometimes one side or the other can be Surprised. The DM determines if this is possible. Usually this will only occur if one side or the other is being stealthy; make a Dexterity(Stealth) check, and any creature on the opposing side whose passive Wisdom(perception) is defeated by everyone starts combat Surprised. Sudden betrayal can also cause someone to be surprised; make a Charisma(Deception)
However, the above allows someone to cheese two surprise attacks out; every sneaky person who wins initiative readies their action, then they all trigger after the surprised folk are oblivious, then they go again next turn.
---
Actually, it goes on to say, "In addition, any hit you score against a creature that is surprised is a critical hit."
So it doesn't have to be a creature at the beginning of combat. They just have to be surprised.
The only way to become surprised
is at the beginning of combat. There are rules that describe how a creature is surprised.
You can homebrew your own surprise rules if you want. But the rules for surprise have been quoted in this thread.