When we brought Luma home, we had an ex-pen set up in our bedroom with all her stuff in it, including a bed and her potty pads. She was okay with it but started climbing out around 14 weeks old. So then we switched her to a crate, and she learned how to open that the same day we bought it

THEN we put a caribeaner clip on the crate door so she can't open it. She slept in her crate okay, but if we didn't let her out bright and early at 6am she'd sometimes pee in it, on her bed. So...we started letting her sleep on our bed and she's never looked back

She only goes in her crate if we go to a relative's house.
We started giving her run of the bedroom at around 6 months, and then we moved to a new apartment. She has full run of the apartment now (bedroom, living room, kitchen and dining) and we have a potty pad in the kitchen and another in the bedroom. She never has accidents.